As for rational consideration, this practice weakens the body and affects it—even the sexual instinct itself. A young man will need this instinct, which Allah created, in the future; so if he marries while this instinct is weak, he will suffer a tremendous loss.
I have found many articles in magazines and books written to explain the harms of this practice, and this is evident. Thus, most of those who do it are pale-faced and lethargic, because it exhausts the body. Accordingly, the evidence for its prohibition is found in the Quran, the sunnah, and sound reasoning.
As for consensus, there is no consensus on the matter, since some scholars have deemed it permissible. However, when there is disagreement, the point of reference is the Book of Allah and the sunnah of His Messenger, peace and blessings be upon him.
If someone says: Has it not been reported from the early generations that, when their sons travelled for military expeditions, they would ask them to use it as a means of relieving themselves (1)?
We say: Yes, but this is to be understood in cases of necessity, not as a general permission. For so long as we have evidence from the Quran, the sunnah, and sound reasoning, the early generations could not have done something forbidden. Rather, it is to be understood as applying to a permissible circumstance.
If someone seeks to discharge semen by means other than manual masturbation, is that permissible or not?
The answer is: It is not permissible, because the underlying reason is the same, whether it is done by hand or by any other means. However, if he merely thinks and then ejaculates, there is nothing blameworthy upon him, but