I do wonder if we need a charitable foundation that does software patents and makes them freely available just to stop cockroaches abusing patents.
Another step (although governance would need to be super good for this). Would be for this charity to withold access to these patents from companies that decide to abuse stupid patents.
I think you do not need to register a patent, you can just publish the idea with a verifiable date, that could be considered as a "prior art". I would suggest to make a free website where anyone can publish any ideas although I do not understand how one can prove the publish date. And then the community could publish everything that might be potentially invented in near future to prevent others from getting a patent.
For example, I would publish the idea of a "self-driving car" that can drive without or with minimal human supervision using a computer. I believe this is pretty novel and can be called an invention.
Also I hope this patent is valid only in US and cannot be enforced in China.
Are you thinking of TDCommons? https://www.tdcommons.org/