ride along in a gear that's giving you highish revs then hit the kill switch. Keep the throttle open and a few seconds later reset the switch. Bang.
Only really works with carburettor engine bikes though as fuel injections systems shut down as soon as you kill the engine meaning no more fuel being pumped into the exhausted un-burnt.
No harm to the engine but it doesn't do the exhaust much good if you do it too often. Packing gets burnt and blown out.