Is this also true for localhost, or does localhost get special treatment? What is a good way to get https certificates for localhost other than self signed certificates?

https://github.com/FiloSottile/mkcert

Still self-signed, but generates a CA that gets added to your browser. It is all pretty seamless.