Ahh yes, it's cached in fnmatchcase. It's pretty fast as well, <10µs for a basic match.
A cache without any eviction! Probably should not expose `fnmatch` to the network where the pattern varies.
The RE engine here is only used as a fast VM; so the pathological cases from the article should still apply. So apart from the memory use issues there's also that.
It should be updated with a functools.lru_cache decorator I think.