MediaWiki has two queues for mw.config variables. A site-wide set defined and outputted by ResourceLoader's startup module (i.e. wgSiteName, wgLoadScript, wgScriptPath, etc.). And one that is page specific (skin, wgPageName, wgUserName etc.).
The latter is hardcoded in OutputPage->getJSVars. Although it can be extended by extensions through the MakeGlobalVariablesScript, it's still annoying to have to define these variables in the hooks file instead of in, for example, the SpecialPage class itself. Another problem is access to the current context's Title object. I added $out to the hook in r96015 (which has getTitle()) but that only makes it a little but nicer.
the hard coded array should be an object member that can be extended via an add*() method. That way a SpecialPage (or for example ProtectionForm - poke bug 31230), can simply do $out->addThingy('wgFoo, 'bar')