macOS Mojave disable all 4 rounded window corners either with defaults, or software, or programatically
I figured it out, I used ThemeEngine to edit the appropriate theme in SystemAppearance.bundle.
I made a repo with the changes here: https://github.com/tsujp/custom-macos-gui
I know StackExchange hate linking answers so here is a summary for my case:

Using ThemeEngine edit the files in DarkAquaAppearance.car
The files you need to edit are WindowFrame_WindowShapeEdges
Change the masks to squares.
Change the base to completely transparent.
Reboot or otherwise restart the Dock, Finder, SystemUIServer, etc.