For performance reasons, static data should go in ResourceLoaderGetConfigVars, not MakeGlobalVariablesScript.
The key difference is that static data (ResourceLoaderGetConfigVars) goes in the startup module and is loaded once (until the startup module is re-generated/cache expires, then it needs to be downloaded again).
MakeGlobalVariablesScript data is in the source code of every page, so it should only be used when the data is request-specific. Generally, this may be specific to the page, user/username, or other aspects of the request.
wgEchoOverlayConfiguration['max-notification-count'] is static (unlike notification-count), so it should ideally be broken into a separate static variable.
ResourceLoaderGetConfigVars and wgEchoConfig are also static. However, there's a complication that wgEchoConfig is set differently when testing. This exception should be dropped so it can be static, if possible.
The comments should also be updated so it's clear to people which one to use.