Would that it were so simple! But it's not.
Ambient, open-air level measurements are pretty easy. In-ear, not so much.
I could offer some knowledge of the difficulties involved, but I'm not a scientist or engineer, and don't want to get out of my depth. It's easier and more accurate to note that -- considering all the media hype about kids and portable audio devices -- if this problem were trivial, it would have been addressed by now, either by Apple or another cell phone maker, by another IEM manufacturer, or by an app developer.
I take your first point about the difficulties involved. Plus, I'm way way out of my wheelhouse on the issue.
Your second point about media spotlight on “protecting kids” is a bit of a stretch (me think). I live in the United States of (by...) America (the land of Sandy Hook, Deepwater Horizon, and “get out of here with climate change”. Europe put volume limits on music players and we (in America) are pumping it up. How hard is volume limits? I expect Apple to do what is in the corporate interest of Apple. That concludes my political rant and back to the scheduled topic in progress.