This can only be done by delegating the verification to national eIDs systems. This way the website simply asks the government: is this person >18? and the trusted government platform can reply without disclosing additional information.
Privacy laws and constitutional protections vary widely across democracies and - in my estimation - for very good reason.
Australia, Canada, Ireland, New Zealand, the UK, and the US have no government-issued compulsory identity cards for all citizens.
I would even prefer it to give my info to Elon Musk. He may be crazy, but he wouldn't be interested in my stupid opinions.