Personally, I’d prefer that projects use forums for community discussions rather than realtime chat platforms like Discord or Matrix. I think the bigger problem of projects using Discord is not that it’s closed source, but rather that it makes it difficult to search (since no indexing by search engines) and the format deprioritizes having discussion on a topic over a long period of time. Since Matrix is also intended for chat, it has these same issues (though at least you can preview a room without making an account).
Yeah I think Lemmy would actually work pretty reasonably. It reminds me of how lots of software and projects have Reddit communities. I agree that being able to share 1 account over many services, and especially not having to pay for infrastructure is something that drives discord use over forum-based platforms.