for msp in metaslabs:
if msp.ms_sm == sdb.get_typed_null(msp.ms_sm.type_):
It looks like this is the canonical way of doing this, but it seems pretty tricky just to check for null.
As an orthogonal cleanup, maybe we should change this helper function. It looks like all the callers
of get_typed_null(type) could be changed to a simpler-to-use helper, something like:
def is_null(obj: drgn.Object) -> bool:
return obj == drgn.NULL(prog, obj.type_)