Leaving GitHub wont change that, OpenAI is training its models on every bit of code they can have, sourcehut, codeberg etc. If its public, they will train on it.
Also from my experience of trying to leave GitHub, you just end up having a couple of projects on your alternative platform, and everything else on GitHub. You are still active on GitHub, probably even more than your new alternative.
And if you want to build a community, you will quickly find out that the majority want to stick to GitHub, and leaving it can kill your projects chances of getting contributions.
Personally if the courts decide its fair use, that's it, I'm going back, its the best got platform out there, gitlab doesn't even compare in free features. However I have been eyeing Gitea and Gitea Actions, with it Codeberg could become a realistic choice for me.
To end it, here is a Hot take, I really hate Sourcehut.
it hard to use, the ui is .. Not great and trying to browse issues or latest commits is a nightmare.
Every time a project uses it, its a pain to deal with.