In Islam is castration permitted? If not then weren’t a great number of slaves castrated by muslims in the past? Also, is masturbation permissible according to any current Marja or early scholar?

1- No castration is not permissible. It’s unjust and a sin. If some Muslims did it in the past, they were violating Islamic law.

2- Masturbation is not permissible and all scholars are in agreement.