It's not a bug in GCC. It's a bug in the code. The second call to PyArg_ParseTuple passes an int* where a Py_ssize_t* should be passed. (The &data_len argument).