No, Stack Exchange has not discovered a vulnerability to change the font on your system or on other websites. Nor have they discovered an XSS vulnerability to inject scripts into Google, as would be needed to recreate these results.
Google has changed their site, something they do frequently, likely in an A/B test.
When I visit google.com I get results like shown in your first image. However when I visit google.co.uk I get results like shown in your second image.
You mentioned the font, but there are more differences than just the font. A notable one is the result header. In the first image the result has the icon on the left, with the title of the site above the URL on the right. In the second image the icon and title are on the left in a grey pill, with the URL on the right.
Changes like that require more than just an overwritten font; that would require injecting a script into Google to change the DOM. Unsurprisingly, everyone has agreed that that is terrible for security, so browsers work very hard to prevent that, as such XSS vulnerabilities are rare.
Here is the view I get on google.com:
And here is the source code for the header:
<div class="q0vns">
<span class="DDKf1c">
<div class="eqA2re UnOTSe Vwoesf" aria-hidden="true">
<img class="XNo5Ab" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABzElEQVR4Ab2WAUQDURjHDw0QIAQkAVBaMwvDJiMbY7QgFgAkAAGZZUASFiyAnQUEotMIGUKgAAYNWxY20Gyv9+d57d52X99mN/zcuee933vv/b+7sxKnyX9pxUORVixUkNe6pCMRQN3XVVuEMxbZ2E4Ej7WARwd9phbKGa/Izg2+aIwGxmAJsTUSMRcmSP2UFcgVqm0UDBzJjcKhZYSQcWZZIsVZjgz8pTEaGniI6mYnQnzCKothzfruFteFKeXL+Fh9J7DdfwyI4ZMlcIUUQDhnmRZeQDTKV3ZLnYU/wmdTiNWenReXqY6xQq8suZ6C8m6psiKFS21TiGeUTAnFDCQsQ6aEgRd/hN3c4oWL3VIIjdAgMMzQNCXvHjS9z1CVxWgtHt4lxaadIcuCkWBhgpS6Cv/jYU0E7YyGL+Ftt+vVVr0PidXKgUu4Y2de57U6PNfCVDWVM2WzSGP5nzwRmg0tBHLgTwg8pD3JkZcoaKfDmFj08k3E84NJstrY9xAHaoi85I6kpMB9T7dX90Tk9sqUuhI/NlNCxkJJXaVgfg99keKKQmf9JmJ7iTNlkg5P/SOMoOgzYmK+MGghkUIMpEKiV457pFMFaJ8z1i/ATnOr+aZzdAAAAABJRU5ErkJggg==" style="height:26px;width:26px" alt="" data-csiid="jfEJZ5z2J7jlwN4P7aK3wQs_7" data-atf="4">
</div>
</span>
<div class="CA5RN">
<div>
<span class="VuuXrf">About Google</span>
</div>
<div class="byrV5b">
<cite class="tjvcx GvPZzd cHaqb" role="text">https://about.google</cite>
</div>
</div>
</div>
Here is the view I get for google.co.uk:
And here is the source code for the header:
<div class="q0vns">
<span class="idGHzb">
<span class="IvHA0">
<span class="DDKf1c">
<div class="eqA2re UnOTSe Vwoesf" aria-hidden="true">
<img class="XNo5Ab" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABzElEQVR4Ab2WAUQDURjHDw0QIAQkAVBaMwvDJiMbY7QgFgAkAAGZZUASFiyAnQUEotMIGUKgAAYNWxY20Gyv9+d57d52X99mN/zcuee933vv/b+7sxKnyX9pxUORVixUkNe6pCMRQN3XVVuEMxbZ2E4Ej7WARwd9phbKGa/Izg2+aIwGxmAJsTUSMRcmSP2UFcgVqm0UDBzJjcKhZYSQcWZZIsVZjgz8pTEaGniI6mYnQnzCKothzfruFteFKeXL+Fh9J7DdfwyI4ZMlcIUUQDhnmRZeQDTKV3ZLnYU/wmdTiNWenReXqY6xQq8suZ6C8m6psiKFS21TiGeUTAnFDCQsQ6aEgRd/hN3c4oWL3VIIjdAgMMzQNCXvHjS9z1CVxWgtHt4lxaadIcuCkWBhgpS6Cv/jYU0E7YyGL+Ftt+vVVr0PidXKgUu4Y2de57U6PNfCVDWVM2WzSGP5nzwRmg0tBHLgTwg8pD3JkZcoaKfDmFj08k3E84NJstrY9xAHaoi85I6kpMB9T7dX90Tk9sqUuhI/NlNCxkJJXaVgfg99keKKQmf9JmJ7iTNlkg5P/SOMoOgzYmK+MGghkUIMpEKiV457pFMFaJ8z1i/ATnOr+aZzdAAAAABJRU5ErkJggg==" style="height:26px;width:26px" alt="" data-csiid="hvEJZ8mIJIXEp84P8KmO8A8_6" data-atf="4">
</div>
</span>
<div>
<span class="VuuXrf">About Google</span>
</div>
</span>
</span>
<div class="byrV5b" style="overflow:auto">
<cite class="tjvcx GvPZzd cHaqb" role="text">https://about.google</cite>
</div>
</div>
You'll notice that the while the class of the outer most div is the same, the class of the first span is different. Beyond that, there are also changes in the structure, with the second one using more spans.
Why is it correlated with logging into Stack Exchange?
¯\_(ツ)_/¯
How Google works is a mystery to everyone but Google.
If I had to guess, when you login into Stack Exchange, one of the Google Analytics scripts that Stack Exchange has on their site installs a cross-site cookie which triggers the A/B test. In the past google has run specific A/B tests for targeted audiences, it's plausible that they're specifically targeting this test at developers for some reason, or maybe it's targeted at users of "forum" like sites.
How can you opt out this?
As far as I can tell, you can't. I know GMail let's you revert to older styles sometimes, but I'm not seeing anything for Google search.
You can however give feedback. If you click on your user icon in the top right corner, and click on 'More settings', there is a feedback link on the bottom of the page. Given this appears to be an A/B test, it's very likely that the feedback will be associated with the A/B test.