Isolate code for Python->c++ data conversion into its own function.