A certain potion of roots mixed with beer was noted as a cure for jaundice – but had a side effect of impotence. The question then becomes – is this permitted? Since the Torah forbids offering a castrated animals as a sacrifice (Lev. 22:24), the rabbis understand that castrating a human is forbidden. Even as an unintended consequence.
But it is a permitted remedy for one already “castrated” ? Or perhaps it (sterilization) is permitted to women - who are not obligated to procreate?
But R. Johanan b. Beroka notes the command to be “fruitful and multiply” (Gen. 1:28) is addressed to both man and woman (“And God blessed them: and God said unto them”).
It seems, then, that this cure would not be allowed except for the elderly.
It’s a big topic handled in only a few sentences. There is more to discuss.