You don’t even need an extension; Safari has a built in setting in the advanced settings to use a custom CSS for all webpages:
You need to create your own CSS file, but that’s a completely different beast. Something that will work nice on some pages might not on others, but I’d create a file named whatever.css and have it contain something like this:
color: #ffffff !important;
background: #000000 !important;
color: #00ff00 !important;
and then load it into Safari via the preferences. To reload any changes to the CSS while Safari is open, you need to select
None Selected and then re-select your custom file.
You’ll probably find lots of people on the web that have put lots of effort into similar CSS files. Good luck!