In 2015 I created this module with the idea that it'd be part of a small group of modules that would host lots of related utilities. The idea being that there would be a small number of modules bundling a larger group of utilities.
The naming scheme was modelled after YUI, which treated its `Y` constant similar to the browser scope, so you'd have utilities like `Y.Object.mixin`, and `Y.String.includes`, etc. I have no idea why I did that, and we never used this style for anything else.
In terms of cost, it made sense at the time because it was a replacement for an existing module, rather than something new. The old module was `jquery.mwExtension`, which included among other functions, `$.escapeRE`. That module was deprecated, except for this function. It needed a new home, and we created `mw.RegExp` for it.
Looking back, this tiny module costs more to describe in startup metadata, dependency relations, and closure wrapping, than the actual contents itself. For an example of how that cost adds up, see T213426#5009603.
Hence, even if it was not loaded on every page, it would save bytes by merging into a module that is. In actually, it is loaded on all pages, and would save even more bytes by merging into a module that also is.
The deprecation for this is low priority because it's only a single module, and it's been around for several years. It's imho not worth the disruption to try and phase this out in a single release cycle.
Plan:
* MediaWiki 1.34 Move `mw.RegExp.escape` to `mw.util.escapeRE`, and make `mediawiki.RegExp` an alias for `mediawiki.util` (deprecated).
* MediaWiki 1.35 (next LTS): Remove `mediawiki.RegExp`.