def METHOD_NAME(pts, polys, name="mesh"):
    mesh = D.meshes.new(name)
    mesh.from_pydata(pts, [], polys)
    obj = D.objects.new(name, mesh)
    if bpy.app.version > (2, 80, 0):
        C.scene.collection.objects.link(obj)
    else:
        C.scene.objects.link(obj)
    return obj, mesh