I get the following message when opening the terminal on mac
Last login: Tue Mar 11 14:33:24 on console login(291,0x7fff78af9310) malloc: *
I had the same problem with my dev machine. After several hours of trying anything other than a reinstall I finally realized that was the only choice. It should have been the FIRST choice. SO EASY!
That's it. When my computer restarted I was prompted for my Apple ID credentials and then my user loaded like normal, with a working Terminal, even. I didn't need to reinstall / restore anything. The whole process (including the user folder backup) took about 45 min.
Final step, remove all of the sketchy utilities installed trying to fix this without a reinstall.