Great way of avoiding 99% of the harm with that, is literally getting off social media, if that ever happens to you. Most people around you in real-life won't know about it, nor recognize you, or anything else, unless you had a pattern of bad behavior for a longer period of time.
But you can still make mistakes, even online, and eventually people forget about it.
That's only true if you fade with your misdeeds. Try doing anything that raises your profile and watch them jump back to the surface.
The gap years certainly hurt, but at a sufficient level of money and power you're broadly fine I think. The real risk of cancelling is for people without money and status who could be shunned by family or friend groups mostly.