GitHub is a crappy company focused on releasing proprietary software. They comply with the regulations of the US government, and are based there. Also, they were bought out by Microsoft, so expect things to get worse there. They matched other git hosting providers with free private repositories to make themselves look good by doing the most basic thing.
There's an alternative, gitlab. In my opinion it's much better than GitHub, which misses plenty of its features. The community version of their software is released under the GNU GPL, and it's stupidly easy to set up your own instance if you need to.
GitLab hosts on Google Cloud servers and, Google blocked access of Iranians IPs over Google Cloud servers since a couple of years ago.
Also as I mentioned before, GitHub centralized Open Source, and Software Development worlds these days, just think about all that services that depend on GitHub. Also, GitHub is the largest developers social network as we know.
I'm not talking about gitlab.com, as I don't trust them after that incident where they lost data they had 5 backups of. You can host your own gitlab instance pretty easily, provided you have a server powerful enough to run it. It's hard to trust something you haven't set up yourself.
I have gitea setup on a raspberry pi and works great.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.