You can do the business logic in QML, that is the best practice nowadays. That is why it is a full blown language based on JavaScript.
Or do little helper classes that you than use from QML, just like those Python libraries that are mostly native code.
Qt also has official Python bindings nowadays, even though the others were dropped, due to lack of interest.
Don't forget automatic memory management can also have other kinds of leaks, and use similar tooling, to track down where references are wrongly being kept alive, e.g. Forms/WPF event handlers.
Or do little helper classes that you than use from QML, just like those Python libraries that are mostly native code.
Qt also has official Python bindings nowadays, even though the others were dropped, due to lack of interest.
Don't forget automatic memory management can also have other kinds of leaks, and use similar tooling, to track down where references are wrongly being kept alive, e.g. Forms/WPF event handlers.