A method for improving sexual function is described. A mammal suffering from sexual dysfunction or otherwise in need of enhanced sexual function is administered a compound selected from those that are capable of inhibiting the activity of β-lactams, penicillin-binding proteins, and carboxypeptidases. Such compounds, including particularly β-lactam ring-containing compounds, can be used to formulate pharmaceutical formulations useful for improving sexual function.