cython shared ptr

this does the same for mcpele as pele-python/pele#48

this depends on the pele PR, so this must be merged after