> sites like github.com which do not allow code running from bookmarklets
I tried a variant of it on GitHub.com. It worked fine. This one turns text red, but you can change it back to black. You can select the text below and drag it to the bookmark toolbar to create the bookmarklet--at least on Chrome/Firefox on Windows. If that doesn't work, you can copy/paste.
javascript:document.querySelectorAll('*').forEach(elem => elem.style.color = 'red')
This one uses a different approach, it adds a dark mode style sheet. javascript:/* /Dark Mode# */(function () {document.head.appendChild(document.createElement('style')).innerHTML = '* {background-color: #121212 !important; color: #888 !important;}';})();