To prevent snakes in toilets, seal potential entry points around pipes and drains, eliminate food and water sources like pet food and standing water, and trim vegetation near the building. Seek professional assistance from pest control specialists for snake removal. Additionally, building codes should incorporate snake-proof design features, and homeowners and renters must maintain snake-free properties. Sanitation workers should be aware of potential encounters and observe safety precautions.