Get active vertex through python
You can walk the select history in reverse and find the first BMVert:

import bpy
import bmesh

ob = bpy.context.object
me = ob.data
bm = bmesh.from_edit_mesh(me)

for elem in reversed(bm.select_history):
    if isinstance(elem, bmesh.types.BMVert):
        print("Active vertex:", elem)
        break


Note that select_history does not support selection operators like box and lasso select. They don't make a geometry element active, nor do they add to the history at all.