A roll pin might do it. Guessing if it can't move, it may not come loose, but a roll pin won't put up with much shearing force. There is a square key on it already with one of the set screws on top of it to clamp it. I would be wary of drilling the shaft all the way thru because if the shaft or the bolt broke, it could drop the print head on the operators hands.
Thought about drilling and tapping one more hole for a set screw and drilling a matching divot into the shaft for the screw to catch.
Keep it coming.
1991 Honda XR628R
1978 Yamaha XT500