Why not just add this to the default extensions loaded by IPKernelApp at all times (like %storemagic is done for all IPython sessions)?