GitHub definitely would and has in the past. YouTube-dl is on GitHub and gets a pass because it is used by researchers and archivists, both are fair use. forgejo.org would let you be your own fedi-github and might be worth checking out (could be easier than designing a plugin system and additional repos).
Oracle or someone worse would buy them. That’s how capitalism works.