If you know OCaml, would you mind taking a look at https://gerrit.wikimedia.org/r/#/c/64263/ . Specifically, it looks from https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Math.git;a=blob... like it only prints extra information (beyond the single-letter error code) for Texutil.Illegal_tex_function .
Given that, I removed parameters from the other ones (https://gerrit.wikimedia.org/r/#/c/64263/8/MathTexvc.php). It looks straightforward, but another set of eyes might help, since I don't know OCaml.
Thanks,
Matt Flaschen