“Satan made their evil deeds appealing to them, hindering them from the right way, although they were capable of reasoning.” (Qur’an 29:38)

﷽
First and foremost, please stop reading this if you are someone who has had a past of sexual abuse and/or has been traumatized by sexual abuse. This post is likely to trigger unwanted emotions or memories that we would rather not stir.
Kindly be advised.
Indeed as Allah (swt) informs us that Satan often may make our deeds appealling or fair seeming to us even though we are capable of reasoning.
In Islamic jurisprudence, extreme need or a state of dire necessity is called ‘ḍarūrah’
Our opponents inform us that what is being addressed is a case of ‘ḍarūrah‘. Such that if a man is fasting in the month of Ramadan and he feels that is very testicles are going to explode that he may alleviate himself via masterbating using the hand of a small slave girl or a toddler.
The logic is medical and legal: if the desire is so severe that it threatens physical injury, the lesser harm (masturbation) is permitted to avoid the greater harm (rupture).
While this is a real conditon known as: Epididymal hypertension, or commonly known as “blue balls,” is a temporary, harmless aching or heavy feeling in the testicles caused by prolonged sexual arousal without ejaculation.
Epididymal hypertension is not fatal. There have been no recorded cases (that we are aware of) where a person has died from such a condition.
Unfortunately, such lack of understanding has led to legal verdicts that undermine the rights of children, violate the sacred law and perpertuate an environment of exploitation of children.
You can see from the following that someone has doubts about this and so he asked an explanation from this Salafi/Athari/Hanbali affiliated website:

The source: (https://www.islamweb.net/ar/fatwa/print.php?id=296044)
Translation:
Question: In Ibn al-Qayyim’s book Bada’i’ al-Fawa’id: And in al-Fusul it was narrated on the authority of Ahmad concerning a man who feared that his bladder would burst from lust, or that his testicles would burst from retaining water during Ramadan, that he should extract the water, and he did not mention with what he should extract it. He (Ibn ‘Aqīl) said: And in my opinion, he should extract it with something that does not invalidate the fast of others, such as masturbating with his hand, or with the body of his wife, or his slave girl who is not fasting. If he has a slave girl who is a child, or a young girl, he should masturbate with her hand, and the same applies to a non-Muslim girl, and it is permissible to have intercourse with her in a way that does not invalidate the fast of others) How can Ibn Qayyim al-Jawziyya say that it is permissible to do that with a young girl?
Answer: Praise be to Allah, and peace and blessings be upon the Messenger of Allah, and upon his family and companions. Now then: The issue of enjoying a young girl has rules and details that we have thoroughly discussed in Fatwa No. 195133. By reviewing it, the problem will be resolved for you, Allah willing, and it will become clear to you that what Ibn al-Qayyim mentioned is not problematic at all. Enjoying a young slave girl or wife is permissible as long as it does not harm her. If intercourse or enjoyment harms her, then it is not permissible.

Source: (https://shamela.ws/book/12003/871)
Translation:
“It is narrated on the authority of Ahmad concerning a man who feared that his bladder would rupture from lust or that his testicles would rupture from retaining semen during Ramadan. He was instructed to release the semen, but it was not specified how. He (Ibn ‘Aqīl) said:
“In my opinion, he should release it in a way that does not invalidate the fast of others, such as masturbating with his hand or with the body of his wife or his non-fasting slave girl. If he has a young slave girl or toddler, he may masturbate with her hand, and the same applies to a non-Muslim slave girl. It is permissible to have intercourse with her in a manner other than penetration. If he desires vaginal intercourse when it is possible to release the semen in another way, then in my opinion, it is not permissible, because when necessity is removed, what lies beyond it is also forbidden.”
Now pay close attention:

From the green dot we can see Ibn al-Qayyim give the least problematic view of the three (between himself, Imam Ahmad and Ibn ‘Aqīl) he states: “And it is more appropriate that he masturbate with his own hand, and not with the hand of another.”
The underlined green text is Ibn al-Qayyim saying: “And the apparent meaning of Ahmad’s words is the permissibility of intercourse in the vagina with dislike.”
So how would Ibn al-Qayyim know this?
Ibn al-Qayyim would have access to the: Ṭabaqāt al-Ḥanābilah

The text with green highlight: “According to Ahmad, apart from Ibrahim ibn Yaʿqūb al-Jawzajānī, for he narrated it from Ismāʿīl ibn Saʿīd, and I have heard Abū Zurʿah al-Ṣaghīr narrating from Ibrahim ibn Yaʿqūb, from Ismāʿīl, from Abū ʿAbdillāh, regarding a man who is seized by desire in Ramadan for intercourse. He said: Abū ʿAbdillāh said: He has intercourse and expiates, and he fulfills his wife’s need. And that is because if the man takes [her], then it is obligatory upon him to fulfill her desire.”
So it is very likely that Ibn ‘Aqīl was commenting on what he saw as a deficiency on Imam Ahmad’s answer. The assumption that one has a wife. The assumption that the wife is not menstrating.
Ibn Al-Qayyim and Ibn ‘Aqīl: Who are they?
Ibn al-Qayyim (d. 751 AH) is a central figure in the Hanbali school. He was the foremost student of Ibn Taymiyyah and authored numerous influential works in fiqh, theology, and spirituality. His recording of this opinion in Badāʾiʿ al-Fawāʾid means it is preserved within the Hanbali scholarly tradition.
Ibn al-Qayyim recorded this opinion in his book, Badāʾiʿ al-Fawāʾid, and he is indeed a major authority of the Hanbali school.
Ibn ‘Aqīl (Abu al-Wafa’ Ali ibn Aqil, d. 513 AH) is a major Hanbali authority. He was one of the most prominent Hanbali jurists and theologians of Baghdad, a prolific author, and a central figure in the school’s intellectual history. He is not a nobody, and no one can dismiss him as such. When Ibn Aqil reports a position from Imam Ahmad, that is a serious, substantive attribution that carries weight within the Hanbali tradition.
So who reports what and who is attributed with what?
Ibn ‘Aqīl is reporting from Imam Ahmad the following: It is narrated on the authority of Ahmad concerning a man who feared that his bladder would rupture from lust or that his testicles would rupture from retaining semen during Ramadan. He was instructed to release the semen, but it was not specified how. Full stop.
Then Ibn ‘Aqīl gives his commentary and understanding:
“In my opinion, he should release it in a way that does not invalidate the fast of others, such as masturbating with his hand or with the body of his wife or his non-fasting slave girl. If he has a young slave girl or baby girl, he may masturbate with her hand, and the same applies to a non-Muslim slave girl. It is permissible to have intercourse with her in a manner other than penetration. If he desires vaginal intercourse when it is possible to release the semen in another way, then in my opinion, it is not permissible, because when necessity is removed, what lies beyond it is also forbidden.”
This is confirmed by the reply to the questioner in the website above:
“It will become clear to you that what Ibn al-Qayyim mentioned is not problematic at all.“
The phrase in Ibn al-Qayyim’s Badāʾiʿ al-Fawāʾid is:
أَمَة طِفْلَة أَوْ صَغِيرَة
Amah ṭiflah aw ṣaghīrah
A break down of the words:
(Amah) her legal status is milk al-yamīn. This text is not addressing a free child. Amah is not an age descriptor it is a status descriptor. It tells you the female in question is not a free person.
(Ṭiflah). The age range is from birth until puberty, but strongly connotes a very young child such as infant or a toddler.
Prima Qur’an comments: We will rule out an infant here because of the obvious reasons. Although the training of a toddler to perform such in this situation is problematic.
One may be shocked. How can someone so young be described as milk al-yamīn.
- Through the process of war. These young ones were not left to fend for themsleves but taken in by the tribe.
- Through the ijtihad of the legal schools. Many Sunni legal schools rule that a child born to someone who is described as milk al-yamīn is themselves milk al-yamīn.
(Ṣaghīrah) is the standard legal term for a minor female who has not reached puberty. It is broader than ṭiflah. It can include older children. However, paired with ṭiflah, it clearly means a very young child i.e a toddler.
Ṣaghīrah being used as a descriptor reinfornces that the Amah Ṭiflah is younger still, as in an infant or a toddler.
Marriage and sex with toddlers according to Sunni Islamic Jurisrprudence.
There is a succint Q & A on this from
https://seekersguidance.org/answers/shafii-fiqh/marriage-with-a-minor

From the perspective of the Ibadi school this view by Ibn ‘Aqīl is shocking and totally unacceptable on many levels and from many angles.
Keep in mind that this view is said in the context of the holy month of Ramadan.
The first issue would be: Can retaining/withholding semen reach the point of causing physical harm?
Does Epididymal hypertension lead to death?
The second issue would be: Is masturbation permissible?
The third issue would be: Is masturbation in the month of Ramadan even permissible?
The fourth issue would be: Is masturbation a sin?
The fifth issue would be: If masturbation is a sin (especially in this month) do sins (in general) validate the fast?
The sixth issue What is meant by “al-amah al-saghirah” ?
The seventh issue: Is non-penetrative sexual intimacy permissible during Ramadan?
The eighth issue: How can semen be extracted without invalidating the fast?
The ninth issue: Is it permissible to marry or have relations with a young girl?
The tenth issue: Is it permissible to show people’s private parts specifically the most intimate areas and is it permissible to display them during Ramadan?
The eleventh issue: The non Muslim slave girl. If this is a marriage from a disbelieving woman how is this permissible?
If this article was insightful you may wish to read the following:
May Allah Guide the Ummah.
May Allah Forgive the Ummah.