Unfortunately the reality is that a double digit percentage of all sites rely on document.write [1]. Whilst it's true that a lot of usage is advertising, it's also used for functionality in sites like Google Docs. Perhaps with a lot of work you could get the usage down to single-digit percentage figures, but disabling it entirely is going to break an awful lot of sites that are unmaintained. For something like NPAPI, where there is a real ongoing cost of support, breaking old content — with a multi year timeline for migration — might be worthwhile, but I think it's hard to make the case that document.write is in the same category. Yes, it's an old and terrible API that causes layering violations, makes writing scripted parsers much harder, and ideally authors would avoid it. But making it go away would be a huge project with relatively low payoff compared to other possible uses of the same effort.
In case anyone else was curious about precisely what those numbers measured, I just confirmed that Lighthouse only reports the no-document-write violation when the page actually calls it so those numbers aren't high due to the sites which still have fallbacks left from the paleolithic-era Web (I'd seen that with Adobe Analytics/Omniture where the tracking code injection had a fallback path for Netscape 2/IE3 until very recently).
Okay sure, but I’m pretty certain about 50% of those site have ads on them. Getting rid of Flash was a much bigger issue but Apple forced it through with iOS and it immeasurably improved the experience (at least for those platformsand largely for everyone). Removing document.write improves page performance as well as browser engines. Everything document.write involves can and should be done in other ways, putting document.write behind a Site X wants to allow legacy Javascript do you wish to continue? Clicking no and the ads don’t load would not be a terrible situation.
Maybe there are other APIs that should be deprecated first but I cannot think of any.
Finally I am pretty certain you could write a document.write polyfill, I’ll have a crack at some point I think.
[1] https://discuss.httparchive.org/t/how-and-where-is-document-...