This is also one of the use-cases I built the Tachi Code browser extension for. It injects a monaco-based editor into the current page when it detects you're viewing a raw file (i.e., the page's rendered body contains nothing other than a <pre> tag).
I'm not surprised to learn anything because I worked at GitHub before.
GitHub is not VS Code. GitHub is a Ruby on Rails website with some React sprinkled on. You can't expect the same performance optimization from a website that a whole IDE has.