Although I don't like the idea of using owning raw pointers in new APIs like this (violates fundamental C++ good practises), this type is mostly meant for writing to files via DNA. So we have to use Blender's memory management via the guarded allocator here. Considered making this an alternative function, but then we'd have to duplicate logif or duplicate memory or so. Not worth it to me.