This is a very old debate, that rotates around the explanation of Shaul Hamelech's suicide. As detailed in Sefer Shmuel Alef p' 31 Shaul fell on his sword to avoid capture by the Pelishtim (no relation to palestinians).
I apologize that I don't have time to find the sources now, but the Rishonim's understanding of this cover a range of explanations: suicide is muttar to avoid pain, suicide is muttar to avoid chillul hashem, suicide is muttar (only) to avoid the potential for sins forced conversion, suicide is muttar to avoid the death's of many (those who would have tried to recapture Shaul or take revenge), suicide is never muttar and he was already dying from arrow wounds and just sped up the process, or suicide is never muttar but he was told by Shmuel he would die and just chose the manner.
The minhag in Europe appears to have been to be lenient and suicide (or kill children) to avoid conversion.
Relatedly, there's a story of a Rav who killed the kids in his shtetl to avoid forced conversion and the army coming ended up capturing just this Rav and brutally murdering him and leaving everyone else alone. The point of this story being that in any case of doubtful death the preferred approach is to hope for life.