Linspace method build in Python's C API
I can't see any obvious memory leaks. If you're worried, then you might start out by seeing what sys.getrefcount tells you.
You will need to package up your array-of-doubles as a new type of Python object. See section 2 of the Extending/Embedding manual.
Since you know that you are creating float objects, you could speed things up slightly by using PyFloat_FromDouble instead of the generic Py_BuildValue (which has to parse its first argument and then dispatch). But this is not going to beat NumPy, because packaging up an array-of-numbers as a new type of Python object is exactly what NumPy does, and that's why it runs so fast: it doesn't have to allocate a new Python object for every position in the list.