Rav Ovadia Yosef (Yabiya Omer Y.D. 2:24.8)… In fact this issue is very confusing in my opinion. How is it possible that the mitzva of repentance can be done by means of the major sin of suicide? Our Sages have said that a person who deliberately commits suicide has no portion in the World to Come… This matter is an explicit verse (Yechezkeil 33:11): “Say to them, As I live, says the L‑rd G‑d, I have no pleasure in the death of the wicked; but that the wicked should turn from his way and live; turn, turn from your evil ways; for why will you die?” And there is nothing that repentance doesn’t help. So why would anyone think R’ Chiya attempt to kill himself in response to what he thought was a sin with an unmarried prostitute - was according to the halacha (Kiddushin 81b)? Look at Sefer Chasidim (#674) …How could he tell his students to do teshuva in a manner that caused them to be killed? It would seem that the Sefer Chasidim is a major support for the Shevus Yaakov. This is a very difficult issue that requires study. Nevertheless in my opinion one cannot learn halacha from stories such as these. Therefore it is prohibited to kill oneself – even for the sake of repentance. I also saw this point in Shevet Shimon (345) which expresses great astonishment at this Shevus Yaakov and he concludes that the halacha is in accord with the Yafos To’ar [and not the Shevus Yaakov]. This is also the conclusion of the Chida in Birchei Yosef (345:3), that even though normally the Shevus Yaakov is more authoritative but logic is in agreement with the Yafos To’ar. [There are many other sources that come to this conclusion and reject this Shevus Yaakov]…
Igros Moshe (C.M. 2:69.4): Also this view (Yaavetz 1:43) that someone who has deliberately transgressed a sin that is liable to the death penalty and he commits suicide that he is not only not punished but it is also a meritorious act – is clearly prohibited even if he had been halachically warned not to do the crime. It is a shameful thing that Rav Yaakov Emden stated and his view on this matter should be totally disregarded.
Kiddushin (40a): Rav Kahana was selling workbaskets. A matron asked him to have intercourse. He said that he first had to get dressed properly. He went up on the roof and jumped. However Eliyahu came and caught him. Eliyahu criticized Rav Kahana for having forced him to travel 400 parsangs to rescue him. Rav Kahana said that the reason that the incident happened was that his poverty forced him to go among women to sell his wares. Eliyahu gave him a purse of money.
Kiddushin (40a): Mighty of strength that do His word listening to the voice of His world (Tehilim 103:20). This is illustrated by R’ Tzadok and his companions. R’ Tzadok was asked to have intercourse by a certain matron. He said he couldn’t do it because his heart was faint – perhaps she had some food for him eat. She replied that she had some unkosher food. He replied that it would seem that those who engage in sexual immorality could eat unkosher food. She lit the oven and placed the unkosher food in it. He then climbed in the oven and sat in it. She asked what he was doing. He replied that anyone who was involved in immorality falls into the fires of Hell. She replied that if she had known that what she had asked him to do was so terrible she wouldn’t have upset him.
Rabbeinu Bachye (Shemos 3): ...Concerning prophecy Moshe was told to remove his sandals which meant to remove physicality which is described as sandals. That is because physicality clings to the body just as a sandal clings to the foot. And just as it is possible for a person to remove his sandal from his foot – so is it possible for him to remove attachments from physicality in order to be prepared for prophecy and therefore be ready to clear to the light of the intellect. Yehoshua was also told to remove a sandal (Yehoshua 4:15) but that was a partial removal of physicality and not all. This was the advantage of Moshe over Yehoshua – that he was more removed from the physicality. This can be seen by the fact that Moshe separated from his wife – something which is not said concerning Yehoshua.
Rambam (Hilchos Ishus 15:3): Anyone whose soul desires Torah constantly, and learns like Ben Azzai and clings to the Torah his whole life – and yet doesn’t get married – has not committed a sin. That is true as long as his yetzer harah doesn’t overcome him. However if his yetzer harah overcomes him, he is obligated to get married. This is required even if he already has children - because he might come to sexual thoughts.
Iyun Yaakov (Kiddushin 81b): [And after his wife revealed that the person he thought was a prostitute that he wanted to sin with was really her] he went and he sat in the oven – Rashi explains that he did this to kill himself. From this we can learn that in the case where he is killing himself for the sake of repentance it is not considered suicide. And this is true even if the sin that he did was not liable to the death penalty - even assuming that he actually did the deed that he intended. This is certainly so since his intent was just to have relations with an unmarried prostitute. And especially according to the implications of the gemora it would seem that he didn’t actually do the deed [Nevertheless he attempted to kill himself to do repentance]. Gra (Mishlei 1:2): To know wisdom and instruction; to understand wise sayings – because even if a person can break his evil inclination and lusts – he must break them according to the rules of Torah and he should not be a greater tzadik from that which is prescribed in the Torah. For example he should not fast the entire week including Shabbos and similar things. The three parts of this verse correspond to the 3 types of intellect found in man – the analytical, the conceptual and the practical. The analytical deals with things like astronomy – the movement of the stars and constellations. The conceptual is to conduct oneself according to principles. The practical is to intelligent live in this world. These 3 correspond to chukim (statutes), mishpatim (rational laws) and mitzvos. Chukim are divine laws (Job 38), mishpatim are rational laws connected with earthly human reasoning while mitzvos join the Heaven and Earth and are the basis for Heaven and Earth and man who joins them. They are also the foundation of Torah and mitzvos and personality traits...
Kiddushin (81b): Whenever R’ Chiya bar Ashi said the tachanun prayer he would say, “The Merciful save us from the yetzer harah (evil inclination).” One day his wife overheard him. She said to herself, “It has been many years that we have not been intimate, so why does he have a need to pray for this – [he obviously doesn’t have a strong sex drive]?” One day he was studying in his garden and she dressed up and repeatedly walked past him. He asked who she was. She replied that she was Harusa (a well-known prostitute) who had just returned. He desired her. She told him to first bring the pomegranate to her from the top of the tree. He jumped up and brought it to her. He came into his house and his wife was firing the oven. He climbed in it [to kill himself – Rashi]. His wife asked him what was the meaning of this? He told her what had happened. She replied that she was the woman involved. However he paid no attention to her until she gave proof with the pomegranate. He said, “Nevertheless my intention was to sin.” For the rest of his life he fasted – until he died from the fasting. Yevamos (63b): It was taught: R’ Eliezar said that one who doesn’t engage in producing children is as if he shed blood… R’ Yaakov said it is as if he diminished the Divine Image…Ben Azzai said that it is as if he shed blood and diminished the Divine Image…They said to Ben Azzai, There are those who preach and also fulfill what they say, others keep but don’t preach – you however preach but don’t do what you say? Ben Azzai, “What can I do since my soul longs for Torah, it is possible that the world can be sustained by others who have children.”
Daas Zekenim of Baalei Tosfos (Bereishis 9:4): And surely your blood of your lives will I require… - This is a prohibition against committing suicide. Bereishis Rabbah asks, “You might mistakenly think that this prohibition applies to cases such as Chananiya, Mishael and Azariah – therefore it says “ach” (and surely). That means that you might think that even in this case where people are dying to glorify G d’s name that one is not allowed to bring about one’s death - even if he is afraid he cannot withstand the pressure to violate the Torah. Therefore the Torah says ‘ach’ to teach that in times of pressure to violate the Torah - that it is permitted to commit suicide. Similarly concerning Shaul who committed suicide to avoid being tortured – an exception is made to allow suicide in such cases where a person doesn’t think he can withstand the torture. This analysis is used to justify killing children during times of religious persecution to make sure they are not converted...
Bamidbar Rabbah (9:3):.. There was an incident with a woman to whom a man made advances. She asked him where he wanted to have their meeting. [After he told her] she went and told his wife. His wife went to that place and they had intercourse. He was very upset when he found out what had happened and prayed for death. His wife told him, “But it was your own bread that you ate from and it was from your own cup you drank.” She said that the cause of his trouble was that he thought that he was better than other men. The solution was to view himself as the equal of other men.
Ritva (Avoda Zara 18a): It says in agada that when R’ Chanina ben Tradyon was being burnt alive by the Roman he refused to open his mouth so that he would die faster from the fire - because he considered it as committing suicide. However Gilyonei Hatosfos quotes Rabbeinu Tam that in a situation where a person is afraid of being forced to violate religious prohibitions that it is permitted to commit suicide. This is also stated in Bereishis Rabbah (34:14): That the prohibition against suicide is Bereishis (9:5), “I will hold you responsible to take care of your life. This teaches that it is prohibited to commit suicide. I might think that suicide is prohibited even in a case like Shaul who killed himself because he was afraid of being forced to violate religious prohibitions – therefore the verse says ‘ach’ to allow suicide in those cases. From here we learn that it is permitted to kill our children during the Crusades because we are afraid that they will be forced to violate religious law.” These words require further study and much investigation but the ruling has already been given by Gilyonei Hatosfos. In addition I heard that the major authorities of France also permitted this as practical halacha. (However see Daas Zekeinim of the Baalei Tosfos to Bereishis 9:5).
Rashi (Avoda Zara 18b): Some say that R’ Meir left Israel for Babylonia because of the incident with his wife Beruria. That is referring to the time that Beruria scoffed at the statement of our Sages (Kiddushin 80b): Women are light-minded. Her husband R’ Meir objected and told her that eventually she would come to acknowledge the validity of the Sages words. He commanded one of his students to try and seduce her. After trying for many days she eventually agreed. She committed suicide from shame. R’ Meir fled Israel out of shame.
Rabbi Akiva Eiger (Y.D. 345:1): A person who commits suicide - See Besamim Rosh (345). Whether it is allowed to commit suicide when overwhelmed with lust and unable to avoid sin see Beis Yosef (Y.D. 157) and Berchai Yosef (Shem haGedolim 10:27). The Ritva (Avoda Zara 18) writes that it is allowed to do so. Therefore if it is permitted it would not be considered suicide. See Shevus Yaakov (2:111) regarding person killing himself in order to repent
Shevus Yaakov (2:111): Question: Someone who has committed adultery and as an act of repentance to comply with the capital punishment he deserves, drowns himself in a river which is equivalent to the punishment of strangulation – is he considered as if he committed suicide or is it considered a positive act of repentance and thus he has the status of one who died a natural death? Answer: … a proof can be brought from Kiddushin (81b) which describes R’ Chiya bar Ashi putting himself in an oven as an act of repentance… Thus we see clearly that it is permitted to repent a sin by suicide… Another proof is found in Bereishis Rabbah (65:22) in which a man died by subjecting himself to punishment which involved the equivalent of all 4 death sentences and it was declared that this allowed him to merit the World to Come… He did this as an act of repentance and thus it was not considered as a forbidden act of suicide… We similarly see the case of the washer man in Kesubos (113b) who jumped off the roof when Rebbe Yehuda HaNasi died and a heavenly voice praised him. Thus it was considered a proper action. The Maharit in his commentary to Kesubos said that he killed himself as an act of repentance…We see then from these sources that if a person kills himself for the sake of repentance it is not considered as suicide and he merits the World to Come. That is because in the place where a baal teshuva stands, a complete tzadik is not able to stand.