No good answer
There is not a good way for this to occur, but I recently heard a suggestion from some researchers as to a way that is significantly less terrible than all these ill-considered alternatives. That's not to say it is good, just that it is better because people tried to think a bit before just shouting "I've got an idea so pay me some money and I'll solve all your problems right now and by the time you find out that it doesn't produce infinite security and access to data for only the people you want I'll have a nice big house and a squadron of lawyers for my defense". In short, the system involves the use of weaker encryption where the keys are not known by any group and where multiple keys are used. There is one master key that is long, so breaking that takes a lot of effort. Each message also has at least one short key that is unique. The process to break it requires a certain amount of brute forcing, but can be done at a cost. Governments would be able to get this, whereas small criminal organizations probably wouldn't. Mass surveillance would be made difficult because it costs the same amount of power to decrypt each separate communication, so you have to do a cost-benefit analysis on each one you want to see. So I quite like the math they use. The problem remains that, firstly, it won't solve the problem of good encryption inside government encryption, and secondly, that bad actors inside or outside government will break it because they don't want a good solution to the problem.
Now that I've heard an idea that actually has a modicum of merit, all the other solutions that are essentially the same terrible one make me wonder why their designers are so stupid.