The "safe" way is to pull in the clutch, shift to neutral, and hit the kill switch on the right handlebar. It's actually pretty dangerous to do this. If you slip and let go of the clutch while the engine is off and you're in gear (Not uncommon. Finding neutral is hard on some shifters.), you'll probably lock up the rear tire. When it regains grip, you risk a high-side.
I usually pull the clutch in and shift to 6th instead. Kill the engine with the kill switch and than flick it to start position right away. I restart the engine by feathering the clutch. In top gear there is little chance of rear lockup, unless you have a super high compression motor. In any case, it's not something you should do all the time, but having done it a few times, it makes me really want a high power, perfectly silent, electric bike. I think it would be really fun. For the freeway riding I would have to get a muffler simulator or something that makes some noise, because, if people do not here you, they usually do not see you.
Silent electric bikes would also be really awesome for riding in the woods. That way you can have some fun without annoying everyone within an ear range and scaring all the animals away.