Print two halves, press fit four 6x3mm magnets, and you are done! I stuck small patches of self-adhesive felt on both halves to take up some slack but mostly to remove rattling when transporting the pencil.
I like PETG for this but pretty much anything is fine.
Print in 0.2mm layers, no supports, and with the outer face on the build plate.
The author remixed this model.
Narrower and redesigned the finger holes.