What's still being missed from the discussion is that Motif allows per-app config, with queries that reach into the app's UI tree, and pick out individual elements.
A custom config can be made for each program to addresses all idiosyncrasies and that could be shipped with the distro as "dark mode" without any code change.