In the case of a faithful struggling with temptations of the flesh, perhaps there is a point when self-mutilation becomes a lesser sin. Even then, the advice would be to ask God rather than a surgeon for help.
A priest, however, in addition to avoiding sin himself should be in a position to teach others. If he had to resort to self-mutilation to avoid sin, he is no priest material.
The point of celibacy is properly ordered sexuality, not denial of sexuality.
I'm not sure of "he is no priest material". There was one Avvakum (born 1621-burned 1682, the founder of "old believers" in Russia, and a very interesting writer). He was counted as leading godly life, both during his lifetime and after his death. Well, he belonged to married clergy. Once, while he was receiving a confession, his flesh became excited - and he immediately put his hand in the candle flame and kept it there till his flesh calmed down. This and other similar acts gave him greater moral authority to place demands on his flock - for he treated himself worse than he treated them.