The proper-ish solution to the problem are zero knowledge proofs: I get my government or whoever to give me a credential with my date of birth, I go to website which asks me for my age, the website gives me a token, I use the token and my gov credential to generate a proof that says "today i'm over 18" i give proof to website, the website verifies the proof using my governments public key and lets me pass. This way nobody knows anything more than necessary and it protects everybodys privacy. [1]
Hey we make it a standard open protocol! So everybody can implement it easily. We finance a open-source reference implementation. All the children are forever saved from harm. We have parties under rainbows and world peace!
[1] ZKRP's Zero Knowledge Range Proofs: https://arxiv.org/pdf/1907.06381