Custom data of vertices, Vertex Layers
1) 

 [i for i in bm.verts if i[my_id]]


This will work because any int value other than 0 will return True. Therefore there's an assumption that you aren't using the value 0 for anything meaningful.

2)

Custom id data is removed after bm.free(). I don't know if it can be wiped before.



for the sake of completeness

&gt;&gt;&gt; import bmesh
&gt;&gt;&gt; bm = bmesh.new()
&gt;&gt;&gt; obj = bpy.context.active_object
&gt;&gt;&gt; bm.from_mesh(obj.data)
&gt;&gt;&gt; my_id = bm.verts.layers.int.new('id')
&gt;&gt;&gt; bm.verts.ensure_lookup_table()
&gt;&gt;&gt; bm.verts[0][my_id]
0


This shows that even before you assign a specific value to your layer.int for that vertex, it will already have a default 0.