For most software projects, there should be a way to buy a commercial support license.
For many, such a license should be required for use in any org which is over X employees. Even if not enforced, this way a conscientious dev can justify for paying for the license.
In addition, for some of the deeper "plumbing" projects, that cannot be really charged for independently, they can included in the licensing of some of the projects that use them, as a clause for certain types of orgs, etc.
Something like - using X also requires a license for log4j of $50/yr - where that could even be a pittance, but included in many projects that benefit.
This will make the software much more reliable, while actually giving a basis for open source devs to have the funds to support themselves, feel self worth, and pay for a lawyer to protect their IP for things like TikTok's move.
As an open source coder, I theoretically love the above, but don't know what license, how to set it up, or how to handle the contracting and payment. In addition, I don't know how to justify my commitment - what exactly am I promising and how.
Nonetheless, if someone like Gitlab were to deal with figuring out the technical steps of the licensing and payments, you bet that I would be happy to move my code off GitHub for it (well, my code is already off GitHub, but whatever), and I bet many others would follow suit.