I thought would be a good idea to run
chmod o-w,o-r,o-x in my home folder and /var/root.
After doing that, programs were unable to start properly, saying they couldn't write to /var/folders. I moved folders to folders 2, but no joy. I ran
chmod -R 755 in both folders and things were kind of fixed, but programs couldn't access the keychain. I restored back the original /var/folders, but now all I get is the Apple loading bar stuck at boot and can't boot to safe mode. macOS Sierra, SIP disabled.