You are assuming that courts will shut this down. Guess what? The Supreme Court is responsible for these laws: https://publicinterestprivacy.org/paxton-age-verification/
There is precedent that indicates otherwise, as this is a clear First Amendment violation.
Requiring commercial services to adhere to certain guidelines is constitutional, even though the Texas law is a bad one and I think a different court may have slapped down the law. Mandating speech (code is speech) is clearly not, especially for noncommercial projects.
I think the key would be getting the right person to explain how this would be like requiring all authors to include a certain sentence in their novel.
Paxton's decision was incredibly narrow (because it specifically targeted sites that served pornography and only pornography) and it's unlikely the court is willing to grant anymore ground.