I use lightmode full time for that exact reason. Other developers tend to think it's weird when pair programming or whatnot.
At night, I just use macos built-in accessibility functions to invert the screen. Work pretty well but sometimes you have to un-invert to view photos.