Donations or grants would probably be best. I'm sure there are community grants available for doing public good.
I've also seen some open source things sell merch, where you buy a hat or something with a particular logo. It's still donating with extra steps, but it's a little different
Our instance admin broke it down recently, and it's actually not too expensive to run. Without wasting money on engagement, growth, data collection, marketing, etc, it's not actually that expensive to run social media platforms I guess
Until you get into image/video/file hosting, it's very cheap. So long as people are ok with off-site storage usage, then it shouldn't cost much at all.
Merch is a pretty big risk, or at least was when I was doing it for bands. I know there are solutions for on demand creation now that might be more feasible