To take this idea further, since I am enamored of it right now, there are things you can do that might be illegal, but would actually improve your chances of election. For example, punching a known child molestor would lose you very few votes.
On the other hand, stripping down to your shorts and dancing the electrical boogaloo while shouting āIām a hamster! I smell of elderberries!ā during a televised debate is no doubt legal. Stupid, but legal.