I certainly would eat some pesticides: many foods, spices and drugs are effective or tasty as a side-effect of their pest-deterring properties.

Caffeine is a natural pesticide, which can can paralyse and kill predator insects feeding on the plant.

Tannin compounds are found in many plants (and are part of the flavour of foods such as tea and wine), where they play a role in protection from predation.

Gardeners often use home-made mixtures of tobacco and water as a natural pesticide to kill insect pests.

Capsaicin, which makes chillies hot, is probably produced by the plant because it does not deter birds (which disperse the seeds) but does deter grazing animals (who would otherwise grind and destroy the seeds with their molars).