Let’s go to the extremes here: let’s say I’m a vegan, and love snakes and want my snake to not eat live mouse, do you think I can feed the snake vegan snake food?
This is all hypothetical as I dislike snakes and love bacon.
Veganism is a philosophy that calls for reducing harm to animals where practical and possible. You can conjure up whatever hypothetical you like, and if you specifically look for situations where harm to animals is unavoidable, then harm to animals will be… unavoidable, in those situations.
However, the vast majority of choices you’ll make that affect the lives of animals don’t happen within the context of these sorts of thoughts experiments. You don’t have to eat rats or bacon in order to survive. So it’s not really relevant, unless you’re actually in that sort of situation.
Personally, I simply wouldn’t keep a snake as a pet, and if I had one, I’d give it away. The delimma you’ve presented pits my feeling of wanting a snake against my ethical beliefs about not harming animals, and I consider that ethical belief to be more important. I could always just watch videos of snakes or go see them at the zoo or whatever. But if you did one of those, “You’re stranded on a deserted island with nothing to eat but a crate full of frozen steaks that washed ashore,” then sure, I’d prioritize my survival because it wouldn’t be practical to avoid them in that situation.