What is the bmesh equivalent to bpy.ops.mesh.shortest_path_select()?
Shortest Path algorithms

Dijkstra's algorithm
 Dijkstra's algorithm to find
the shortest path between a and b. It picks the unvisited vertex with
the lowest distance, calculates the distance through it to each
unvisited neighbor, and updates the neighbor's distance if smaller.
Mark visited (set to red) when done with neighbours.

Here is a bmesh take on this.  The algorithm calculates the shortest path from source vert to all verts.
To clean this up would prob make a class of the method, that once built would return this info
import bmesh
import bpy
from math import inf


class Node:
    @property
    def edges(self):
        return (e for e in self.vert.link_edges if not e.tag)
    
    def __init__(self, v):
        self.vert = v
        self.length = inf
        self.shortest_path = []
        

def dijkstra(bm, v_start, v_target=None):
    for e in bm.edges:
        e.tag = False
    
    d = {v : Node(v) for v in bm.verts}
    node = d[v_start]
    node.length = 0
    
    visiting = [node]

    while visiting:
        node = visiting.pop(0)
        
        if node.vert is v_target:
            return d
        
        for e in node.edges:
            e.tag = True
            length = node.length + e.calc_length()
            v = e.other_vert(node.vert)
            
            visit = d[v]
            visiting.append(visit)
            if visit.length &gt; length:
                visit.length = length
                visit.shortest_path = node.shortest_path + [e]
      
        visiting.sort(key=lambda n: n.length)

    return d

# test call select two verts edit mode
                 
context = bpy.context
ob = context.object
me = ob.data
bm = bmesh.from_edit_mesh(me)
v1, v2 = bm.select_history[-2:]            
           
# calc shortest paths to one vert
nodes = dijkstra(bm, v1)
# specific target vert (quicker)
#nodes = dijkstra(bm, v1, v_target=v2)
# results of other vert
node = nodes[v2]
print(node.length, node.shortest_path)

for e in node.shortest_path:
    e.select_set(True)
    
bmesh.update_edit_mesh(me)

Notes. Added option to target a destination vert to yield when the result for that vert is reached.
Another addition would be to save the  alternative route when the distances match. Multiplying each node in the resultant path will give the combinations of possible routes.