Only because repr() prints “totverts=…” doesn’t mean that there’s ever an attribute totverts, and even if there is, it doesn’t mean it’s necessarily exposed to Python.
len(face.verts) is still your best option in Python.
repr(bm.faces[0]).rsplit("=", 1)[-1][:-1] is probably less efficient.