def METHOD_NAME(obj, name='uv_map'):
    assert obj.type == 'MESH'
    n = len(obj.data.vertices)
    data = np.empty((n, 3), dtype=np.float32)
    for loop in obj.data.loops:
        u, v = obj.data.uv_layers.active.data[loop.index].uv
        data[loop.vertex_index] = u, v, 0
    attr = obj.data.attributes.new(name, type='FLOAT_VECTOR', domain='POINT')
    attr.data.foreach_set('vector', data.reshape(-1))
    return attr