In Python, all data (even simple integers) are all allocated on the heap. ToPyObject makes a deep copy of everything, converting everything to `PyObject` on the heap, so all data is owned.
The numpy crate helps if you need to convert large arrays to Python, as numpy does not store every element separately on the heap.