My first idea was to use the Gitea instance of the Free Software Foundation Europe, but T&Cs strongly encourage only projects with direct relation to the FSFE activities, so personal projects don’t seem welcome.
The first-party Gitea platform seems to be in risk of becoming for-profit.
What’s wrong with gitlab?
It’s operated by a publicly traded company. That seems be an extreme case of “for-profit” that OP is trying to avoid.
It has an awful UI layout.
It’s pretty hard to log in nowadays in some cases. Like, with my hardened firefox profile I can never get through the cloudflare automatic bot check (not even a captcha, just a reloading page that fingerprints) even if I allow the usual things.
But the Librewolf team probably has a list of reasons publicly available, as they have just moved from gitlab to codeberg for reasons like this. Simply put, gitlab is becoming user hostile.
So far I didn’t have any issues logging in even on firefox with all the usual plugins and privacy settings enabled. I think saying that it’s user hostile is a big exaggeration. I see how it’s not ‘non-profit’ but I think it’s still a great place for open source projects. I self host it and use the official page and it has been a very useful, good quality tool.
Try to publish code anonymously on gitlab with Tor. They won’t even let you login.
Why why I do it? I have some open source code there and I link to my repos from LinkedIn. My code is not secret. If it were I would self host my repos. I’m not saying gitlab is great for everything bitits is good for many things.
No protection from fire though. Just because you aren’t fussed about privacy, doesn’t mean others aren’t. Some folk like nudist beaches, others do not.