I have embedded a Python interpreter in a C program. Suppose the C program reads some bytes from a file into a char array and learns (somehow) that the bytes represent text
You don't want to decode the string into a Unicode representation, you just want to treat it as an array of bytes, right?
Just use PyString_FromString:
char *cstring;
PyObject *pystring = PyString_FromString(cstring);
That's all. Now you have a Python str() object. See docs here: https://docs.python.org/2/c-api/string.html
I'm a little bit confused about how to specify "str" or "unicode." They are quite different if you have non-ASCII characters. If you want to decode a C string and you know exactly what character set it's in, then yes, PyString_DecodeString is a good place to start.