You can do so for sure. But can you do all these platform specific optimisations in Electron?
And even if you could, the reason companies go for electron is that they don't want to bother with platform specific stuff so they're really likely not to bother.
A agree a mere few megabytes of text should not bother any computer made this decade by the way and that teams is a pig of an app.
But the problem is not what's possible, it's them prioritising new features over performance and with that all the technology decisions they made.
How do you know what's supposed to be in the viewport, especially if the font isn't monospaced? You have to 'render' the entire thing at least once - at least to the point of measuring the dimensions of text (not a cheap thing) and figuring out where you have to force linebreaks. And whenever the user resizes their window horizontally or does various other things, you have to do it again.
Your typical browser is already pretty good at this - not to the point some dedicated text viewers/editors are, but pretty good.