This is called a poultice, and was traditionally administered by rubbing an oily substance (with hot pepper-like spices) on the male genitals, along with some way of preventing removal, such as a sealed bag over the genitals or bound hands. It is also called "peppering", and was a traditional punishment for
****. It is effective and harmless, and I think should be brought back as a punishment for male sexual misconduct.