A beer can sized 200V 36,000 uF capacitor can give you a tazer like shock with just a 12V charge.
When I was working on mainframe computers the power supplies had a few big caps like that and I would run a pair of bare copper wires like candy cane around the body, charge it up, and leave it on the bench with a note saying 'Do Not Touch'.
Nobody ever picked one up twice ;-}
Though as fun as it sounds to taze a thug, it's not really practical without an on-board battery.
I use a keylock switch epoxied to the top of the CDI to disable the engine.
When the switch is ON it shorts the CDI inputs so it won't start.
I had a customer tell me he was at convenience store and some thug tried to jump on it and ride away.
He just jogged up to him trying to escape and taught him a lesson.
You can't jump around it, and bashing the epoxied cover takes the CDI's wire with it so the thief wound need to buy a new cdi at the least.
At home a simple alarm is easy.
A simple box with a siren that once turned on, any break in the circuit triggers the alarm. Remember the old household window tape strips?
Like that.
Just a thin 2 conductor wire long enough to reach your bike with a pair of alligator clips on the ends.
Clip them to anything, like a spoke near the ground, and activate the alarm.
Move the bike and the clips come off and set off the alarm.
You hear the alarm and the thief can't use the engine to make an escape.
... and you don't blow your bike up or hurt yourself ;-}