Three methods I can immediately think of (depending on the mesh):
If it’s a subdivided quad-mesh, one can make NURBS patches and find geodesics on these (example here).
If it’s an evenly triangulated mesh, one can make a graph and find shortest paths (roughly equivalent to geodesics, example here).
Use Kangaroo to pull and minimize/relax a polyline onto the mesh (this should work with any mesh).
That said, there are explicit methods out there developed for mesh geodesics (like this one). Perhaps someone has implemented one of these in GH.