It is a common misconception that snakes give birth through their mouth. Yes, snakes do carry their babies in their mouths, but that is in case they need to protect them.
For example, pythons give explicit attention to their younger ones in their early life, which includes carrying them in their mouths while going from one place to another. It is a way of protecting them.
There are different ways in which snakes give birth. Some snakes give birth by laying eggs, they are called oviparous, while the ones that give birth to live offspring are called viviparous. Then there are those that lie between the two who are called ovoviviparous. In short, the process is complicated and has variations.

Snakes give birth through their cloaca, which is also used to get rid of feces, fart, and mate. They can remove eggs through the mouth while vomiting. They may also steal the eggs of other animal species by swallowing them. Just in case someone catches them, they throw up in order to remove the eggs and attempt to escape freely.
Boas. Aside from the mysterious Calabar boa (Calabaria reinhardtii), all other boas and their relatives give birth to live infants. Boa constrictors, rainbow boas, tree boas, sand boas, and anacondas are examples of snakes that fall within this category. They are mostly found in central and South America, with a few in Africa and Asia.
Some Elapids. Cobras, coral snakes, kraits, and their cousins are all included in the elapid family, and most reproduce by depositing eggs. There are a few notable exceptions to this rule. All sea snakes, including death adders (Acanthophis), give birth to live offspring. Except for Antarctica, these species may be found all over the globe.
Vipers. There are a few notable exceptions to the rule but almost all vipers, including pit vipers, give birth to live offspring. Snakes, like vipers and pit vipers, may be found across the world, including in North America, Europe, the Middle East, Africa, and Asia. Several species survive in extremely cold temperatures, yet they are all poisonous. These are snakes that give birth to live offspring!

Why Did Livebearing Snakes Evolve?
Both viviparous (without eggs) and ovoviviparous (with an egg kept within the female body) methods of giving birth to live young snakes have been addressed before, and both result in fully functioning baby snakes.
The vast majority of viper species, all rattlesnake types, boa constrictors, and green anacondas, as well as other members of the Boidae family, give birth to live offspring.
They belong to the Hydrophiinae subfamily of the Elapidae family, which contains poisonous cobras and adders as well as mambas and other sea snake species. Almost all sea snakes give birth to live young, with the exception of Laticauda (shown above), which implies that infants are born alive in the water.
When it comes to snakes, there is no parental protection, thus newborn live snakes are entirely on their own. The hatchlings are left to fend for themselves from the moment they are born. Hence, snake pups like rattlesnakes are born completely armed with fangs and venom, ready to deliver a lethal bite to their victims.
Ovoviviparous species of snakes are those that are capable of giving birth to live young. A rattlesnake belongs to this kind, meaning a female carries eggs for three months before the eggs hatch within the body and the young are born alive.
There are still significant differences between ovoviviparous and viviparous live births when it comes to animal reproduction (such as most species of mammals). Ovoviviparous animals have eggs that grow and hatch within the mother body and stay there for a while so that development may proceed.
Ovoviviparous snakes, in contrast to many viviparous species, do not have umbilical cords or placentas to feed, oxygenate, or exchange waste. Garter snakes, for example, are commonly known under this umbrella.

Ovoviviparous babies like the garter snakes eat on the yolks of their egg sac when they are initially born within their mother. Ovoviviparous children have more time to grow in their mothers because of their delayed birth after hatching.
As a result, they are farther along in their development than oviparous snakes that hatch from externally deposited eggs or viviparous species (they are bigger in size, better equipped to feed and defend themselves) after birth. Rinkhals, sea snakes, water snakes, garter snakes, boa constrictors, anacondas, white-lipped snakes, rattlesnakes, and Amazon tree boas are some types of snakes that give live birth.