I didn’t reinstall macOS.
- I made sure macOS Mojave is up to date. (I have a 2015 MacBook Pro which I upgraded from High Sierra to Mojave.)
- I removed Xcode from my computer as I don’t need/use it personally. (Optional step, you might not have it installed)
- I fully removed Homebrew. See step 0 above. (This is what I mean by removing dev environment)