Here you go: 'tagtest' is the tag for the file I'm using.
>>> from Foundation import *
>>> from ctypes import *
>>> libc = cdll.LoadLibrary("libc.dylib")
>>> path = "/Users/theo/Desktop/tagtest.txt".encode("utf-8")
>>> cPath = c_char_p(path)
>>> data = create_string_buffer(4096)
>>> name = "com.apple.metadata:kMDItemOMUserTags".encode("utf-8")
>>> dataSize = libc.getxattr(cPath, name, data, 4096, 0, 0x0001)
>>> dataSize
52
>>> nsData = NSData.dataWithBytes_length_(data, dataSize)
>>> NSPropertyListSerialization.propertyListWithData_options_format_error_(nsData, kCFPropertyListImmutable, None, None)
(
tagtest
)