Fix the ownership of a string buffer

When parsing the function arguments, the string buffer is owned by the
python interpretor. We need to make a duplicate if we want to make
further use of this buffer.