This is a serious question which deals with what is now a fictional construct, but one that has ramifications and which has been dealt with (in other situations) by halachic discussion such as this among others.
I know that it is forbidden to kill yourself, even if it is done to save other people. I read this:
- However, there is also a ruling of Chayecha Kodem, which teaches that your life takes precedence and therefore one is not allowed to place one’s self in a life threatening situation to spare another from a life threatening situation. One can not commit suicide or place himself in peril in order to save another person.
(emphasis mine)
This site clarifies and says that suicide is equated with murder.
The process of becoming a zombie, though fictional, points to a gap of time during which becoming a zombie is inevitable and the individual is guaranteed to no longer be alive while the threat to others increases. If one cannot get himself into a proper containment and it is clear that once he becomes a zombie, with the extra zombie speed and strength, innocents will die (and become zombies, only to kill others) may one commit suicide in order to save others and, dare I say it, humanity?
May the zombie-to-be view himself as a rodef who, during the unstoppable process of becoming a zombie is creating an imminent threat to others and a spiritual threat to himself by preparing to do an aveirah?
The law of the pursuer (rodef): In the Mishnah Sanhedrin 8:7 it is stated that, if a person (Reuven) sees someone (Shimon) running after a person in order to kill or rape that person, then Reuven may kill Shimon in order to prevent the crime. This law is explained at length by the Talmud and codes (see Babylonian Talmud Sanhedrin 73a; Maimonides Laws of Murder 1:6). One may kill a rodef only if one sees him pursuing another person with the evident intention to kill that person, and killing the rodef is the only way to save this person.
From here. There is further discussion and source material here including a statement from rashi that "anyone can kill the rodef to save him from sin".