The Libyans have the legend of the amphisbaena as a two-headed snake, although in this version the heads are at each end of the snake, that was written about by Pliny the Elder.
In truth two-headed snakes are not that rare. Snakes with polycephaly, or two heads, are generally conjoined twins. Typically one head is parasitic in that the other head “grew” the rest of the snake’s organs and the parasite head simply uses them.
Snakes hunt by smell. Two-headed snakes can confuse themselves with their own smells.