ULS loads 26kb of JavaScript [1] (after gzip) to every desktop page. However most of this code goes unused, unless the user clicks the language button. It consists of the modules: ext.uls.compactlinks', 'ext.uls.geoclient', 'ext.uls.interface', - which ones loaded vary based on certain configuration options.
Ideally the uls-settings-trigger element would be rendered on the server side and a small amount of JavaScript would be added to the page, to make sure that the settings cog opens a dialog like so
{F30941121}
Upon clicking, all the other modules should be loaded using client side checks rather than server side checks.
It's possible, we might want to compare code in Page previews with this feature - the UI component here is very similar, and this might benefit from a shared component in core.
[1] For comparison, VisualEditor is 10.7kb and Page previews is a delayed load of 18.5kb.