How are people here saying they've never heard of this? Oof... Typical developers, not even familiar with their tools.
I believe OSX ships with Python2 by default, right?
https://docs.python.org/2/library/cgihttpserver.html
Hmm...
Implying that it's a mistake because people don't know about it is very odd. Clearly, I know about it, as do others.
It's been possible for 10+ years to serve git repos using gitweb, and mercurial repos using hgweb. We did this in like 2007-2009ish, locally, in our LAN, among developers... because our code couldn't be pushed to a third party for... reasons.
Eventually I did setup our own internal SSH server to serve the repos, but for quick browsing of a team's repo state, using the built in HTTP server is just fine.