mwparserfromhell includes a tokenizer of wikitext, with a cython version for efficiency.
A mandatory dependency will allow extract_templates_and_params_regex and _ETP_REGEX to be removed, and will mean the result from extract_templates_and_params will be consistent on all platforms.
There was a mandatory dependency on mwparserfromhell for unix, however it was made completely optional in T78378: Depend on mwparserfromhell consistently across operating systems due to v0.4 (2015-05-24) failing to install on Python 3.5 as was discussed at T68010#1306226. I believe this is still not fixed.
We hope to re-enable Python 3.5 builds soon in T106224: Python 3.5/3.6 compatibility, but they might be allowed-failures.