python: Add pystring_as_cstring function
This helper allows accessing the inner bytes of
PyObject according to python version:
- Py2: String object
- Py3: Unicode object
This method is mostly used for paths as a temp
solution until we add the path convertor.