Not that any snakes have personally confessed to me, but I think it can be either way. Remember that a snake's body is essentially a long horizontal "tube", so when you "handle them" it usually means they're spending some time being vertical, being more active, & being "folded" (for lack of a better term): ALL of these motions (along with gravity!) will tend to "help" or even "force" them to defecate, just like activity or fear can have the same result in any other animals, including us.![]()
FYI, "musk" is NOT a defecation but an actual defensive response out of fear- it's a snake version of chemical warfare, lol. King snakes especially (& others) are known for this response, especially as hatchlings, since they're too small to even bite effectively. They also instinctively spray fecal material without musk- it's very effective at making them less appetizing to predators. I've raised many a corn snake & I don't find them to be prone to this behavior. Same goes for ball pythons. But just try sexing a bunch of hatchling king snakes...Been there. Suggest a rain coat.
When a ball python defecates on their handler, it's most likely that the handler has not yet learned to pay attention to whether or not there's a bulge above the snake's cloaca from the latest meal when they're initially picked up from wherever they're resting. So then it's on them....literally.![]()