reduce C code overhead for C++ std::string -> PyObject conversion helpers by implementing them directly in C++ and not Cython