pybind: Use basestring as string type for Python 2
Python 2's built-in string type is an 8-bit string, thus does not specify any
particular encoding representation (str and bytes are synonymous).
On the other hand, Python 3 strings are always Unicode strings and thus require
some form of encoding before they can be passed to char* based C APIs.
Because we now explicitly encode and decode strings used in C APIs, functions
that return "strings" will now return a Unicode string. To allow these values
to be safely round-tripped in Python 2, we must allow use of both Unicode
and 8-bit strings as "string" arguments. In Python 3, the Unicode str type is
used instead.
8-bit strings will be assumed to be using Python's default ASCII encoding,
while Unicode strings can accept any encodable string value.