Pass a law that requires devices and software to support a per-device or per user account 'child' or 'minor' flag. The flag must be lockable with a password or another account. Pass a law that mandates that websites and content handle the flag appropriately, whether that means denying service or limiting access.
This would protect children while only minimally infringing on privacy.
The mechanism by which we make everyone 'just' is laws. The laws that are being passed are telling of the actual goals.
I too think this is likely the only workable solution. My bias is the OS/ecosystem layer is the right place to handle access to the digital world.
However as digital access becomes more and more essential to doing anything in life, this makes the layer even more load bearing, so I wish to see a legal framework for privacy/security as well as appeals process for the painful edge cases where people get locked out for whatever reason. That problem is even harder.