unless Cubit is directly interfacing with an external module like numpy, it would be easy to use the Python Stable ABI to make the software independent of the Python 3 minor version.
https://docs.python.org/3/c-api/stable.html
Also, being a module, cubit should not be explicitly linking against the python shared library.