See this add-on on the kodi.tv showcase
Wrappers around Kodi Python API that normalize handling of textual and byte strings in Python 2 and 3.