A ton of proprietary code lives on GitHub, on closed paid repos. A lot of people reasonably think that GitHub's security chops are better than theirs.
But if you care, there is a whole gamut of on-prem solutions, from running bare cgit to fluff like Gitea and GitLab.
Lock up your central repo machine all you want, the code is still checked out to developers' laptops. For more security, don't allow that, and let your devs connect to a server with all necessary tools and access to the code, but without general internet access, for instance.
I doubt there is a big enough market of anarchists for Github to even bother worrying.
> One such service is an end to end encrypted Git repo service.
There are so few people that need this, that they can just use client side tools and store all data that gets to remote servers encrypted