Two things. First, this is what Ardour does (self-hosted on gitlab, mirrored (for now) to github).
Second: it is important to get over a basic misconception that some people have about git repositories. The really important thing to understand is that no single instance of a git repository for a project is priviledged or special in any way except for one: an agreement by developers to use it to easily push/pull commits to each other. There's nothing to stop a project from suddenly switching the location of the repository considered to be "canonical", because all it really means is "we all agree to push/pull to/from there".
Now to be sure, github (and gitlab) provide hosting services that go well beyond those provided by a basic git server+repository. Those things are nice (for some purposes, anyway), but they are less important add-ons for developers actually involved in a project, for the most part.
If we decided to switch away from the repository on
git.ardour.org to one on another network-connected system, it would be essentially trivial. There is nothing special at the git level about that repository other than it being marked as the "origin" for developers' initial clone operations.
There's no reason to be concerned about what happens at the repository level at github (or anywhere else). What might be lost are cool web-enabled services. But a repository is a repository is a repository.
One small exception to this (and the reason why you need gitlab or some equivalent to self-host) is managing access to the repository. Git itself provides no such mechanisms for controlling this, which is at once both sensible and a nuisance. For Ardour, this is really the only value-added that comes from having gitlab wrap our git server instance.