Head musings: what is a head? Can it still be a head if it does only some of the things the first head does?
First, a mental exercise. Consider the penis. One organ and one orifice combines urination and procreation, and some think also sexual display functions. Certainly these functions could be split or others added: female mammals have 2 orifices for these functions, and the reptiles include defecation in the single orifice of the cloaca.
The head of a vertebrate also has multiple roles. It contains the start of the digestive tract. It contains the start of the respiratory tract. It contains mechanisms for making sound. It contains weaponry. It houses the brain and sensory apparatus. And: by its appearance and appurtenances, it proclaims to friend and foe: I am the head of the animal I am. It really is a ridiculous amount of stuff to house in one place and I am sure the echinoderms think we are silly.
The question: a snake with two heads. If we can have a thing be a head but not necessarily carry out all of the functions of our own human head, it becomes much easier.
Easiest is the single function: to declare to the world "I am a head". Here is the amphisbaena, a real reptile named after the mythical two headed snake. Also: the fat-tailled gecko.
The tail of these reptiles appears like the head, and vice versa. If the simplest head is a thing that proclaims "I am a head!" then these things have 2 heads.
What about a more functional head? Could a second head take on more of the duties performed by the first? The easiest would be offensive / defensive duties. Duplicating a mouth that can bite would be doable. Defensive apparati on the "tail" is already a done thing, with the simplest being big iguana-like tails that lash and the best probably being the scorpion. It is a good place to put a tail gunner head, because probably you are running away.
I like a division of labor between the heads. Main head is in charge of eating and tail head is in charge of defense. Eyes on the tail head would help with that. And it occurs to me that a second defensive snake head that could bite might benefit from a venom different from that of the first. A head that eats needs venom with the ability to quickly incapacitate prey animals. A head running defense needs venom that hurts terribly (like bee venom), blinds, or otherwise deters predators probably larger than the snake.
What about excretion? Digestive tracts are linear and you don't really need two. The cloaca could be under the chin of the tail head. Or the tail head might use the proximity of waste materials to augment its defensive apparatus. Snakes already shoot pee and poo defensively.. Using that good stuff as a carrier for sprayed venom seems awesome for a defense tail head.
I am thinking of a medieval Game of Thrones type world, where one of the Kings sidemen is called Tailhead (not to his face) because his role for the king is similar to that of the above described tailhead of the 2-headed snake.
Last: breathing. On thinking about this 2 headed snake I wondered: how do snakes not compress their trachea shut when swallowing huge prey whole. On reading up, exactly that happens. Snakes have an adaptation for holding their breath for a long time.
Another lung difference is that snakes have 2 separate lung chambers
in the right lung. The first is the same as a humans, but the second
is an air sac. The second is for storing oxygen, because when snakes
eat their food it fills up their mouth not allowing them to breathe.
The additional air allows them to survive without breathing for up to
two whole hours!!
If you could breathe out of a head different from the one with its mouth crammed full that would be a sweet workaround.