Accessing weights of a bmesh
I think it's

layer_deform = bm.verts.layers.deform.active
assert layer_deform is not None

bm.verts.ensure_lookup_table()
bmv = bm.verts[0]
bmv[layer_deform][vertex_group_index] = weight

# or
names = tuple(vertex_group.name for vertex_group in obj.vertex_groups)

for vertex_group_index, weight in bmv[layer_deform].items():
    name = names[vertex_group_index]
    print("Name: %s, Weight: %f" % (name, weight))


Links:


bmesh.types.BMLayerAccessVert.deform
bmesh.types.BMDeformVert