Within government, there is compartmentalization and consequences etc. which generally worked before the rise of lawlessness beginning with Trump. The IRS data is not shared with other areas of government by law for example. State level systems can block federal access; it also limits potential breach size. Standard protocols etc being mandated for use by everybody, but the administration of the systems using those can be decentralized and compartmentalized.
Yes, you can't have the service provide a fully anonymous result and do identification. I'd like to see somebody's solution if it's possible. As far as children using a computer in parental mode, it only needs to volunteer the info about what age-related user groups that user belongs to websites or software. Presumably, the child won't be able to operate hacks that circumvent this... The sites would trust the indicator. If you indicated "adult" then you'd have huge incentive to fake that; but next to no incentive to create tools to fake being a child.
The purpose of these laws in places like Texas is to force adults to indicate they are adults; it is to track them, shame them, discourage adult behavior, and add identifying info like birthdays to kill privacy.
Me, I think a photo ID detailed enough to compare their photo to the ID at a human-level of competency. I would make this photo as low resolution as possible so it could be stored in a 2D barcode on an ID card. The photo on the ID would match this digital photo which is also digitally signed by the state. An 18 year old or 21 year old could be carded the traditional way but automated tools could show the digital image and that compared with the photo to see if the person matches. It doesn't need a name, address, birthday or anything other than you are old enough to drink or whatever. This could be different for different kids such as a French student being allowed to drink despite being under 21.
Driving could be similar. Citizenship could be similar. Voting rights could be similar (but shouldn't... well, I think if you pay taxes then you should be able to vote. Like the founders of the nation said, "No taxation without representation!" If you don't pay tax, you can't vote.)