What scope should it be declared in? When building with autotools, I do not experience this failure.
One idea is you are using a bleeding edge Python. Those Python developers are like grocery store managers: they have to keep changing the location of things to appear like they actually do something constructive.
The tdeutils/superkaramba/src/meter_python.cpp file is the only place I find the function PyString_CheckExact being used. The meter_python.cpp has the following include:
#include <Python.h>
I have Python 2.7 installed. The Python.h header file has a bunch of other header file includes, one of which PyString_CheckExact is defined.
Perhaps look into where PyString_CheckExact is defined in your version of Python. My guess is your version of Python.h no longer contains an include where PyString_CheckExact is defined or perhaps PyString_CheckExact has been replaced by a different function.
Just guessing.
The only thing certain in free/libre software is tomorrow somebody upstream will break something that works today.
Darrell