I don't know about toilet training snakes. I've heard with some reptiles, placing them in lukewarm water stimulates them to "go", thus ensuring they won't during an outing or handling session. Also with snakes, close supervision crawling on a lawn can encourage them to defacate, after which they won't do it again for a little while.
As for just training snakes, that's tricky. Since they're solitary animals unlike dogs or horses, they don't give a rats ass about how their handler feels and don't want to please. And unlike animals you can train by food reward such as cats, all their intellect goes out the window at feeding time, and training then becomes a moot point when they're not thinking.
But they can learn by association such as learning that their human is a safe warm place to explore and thus desirable to be around (or at least tolerate) and they can pick up cues to associate that when their person does this, it's feeding time.
I've heard stories about a burmese python who knew it was feeding time when a strobe light started flashing, a snake (forget the species) that consistently came when its owner gently patted the surface it was on, and I've read an astounding account of a racer that when its owner dangled a mouse a respectful distance away, it followed, over a few obstacles, climbed up to it's owners arm and then ate the mouse with no fear or feeding errors.
Toilet training a snake however, stumps me.
-----
0.1 chickens (Condor)
0.2 dog mutts (half ownership, only mine when they misbehave, Lucy & Amy)
0.1 Halflinger horse (Crissy)
0.1 Normal phase California Kingsnake (Sophia)
1.1 parents
Still searching for 1.0 WC human