A third way would be to use a neural network to analyze a message before encryption, or to duplicate the message for receipt by the service provider.
In any case, advocating for mandatory digital spies on end-users' devices is arguably worse than attempting to undermine E2EE.
What you are proposing is a pluggable censorship module that can identify any forbidden speech and report back to the authorities. It will take less than 16 months for every regime to co-opt for their own aims. It will indirectly lead to the deaths of thousands of dissidents.