this also repairs the unsoundness in typing of unpack_slice, which was silently converting a const ptr to an imm one.