This website contains age-restricted materials including nudity and explicit depictions of sexual activity.
By entering, you affirm that you are at least 18 years of age or the age of majority in the jurisdiction you are accessing the website from and you consent to viewing sexually explicit content.
I think you’d need a little more than that to make sure the restriction isn’t used defensively by harassers (one of the reasons people ask for this is to show others bad behavior in their replies). But it does feel like a solvable problem.
And Mastodon having more active moderation (since you can proactively look for an instance that meets your moderation expectations) also means the stuff that can’t be handled mechanically can be managed.