You may simplify Earth as a sphere with 40 Mm circumference.
I thought about it when I read the Mercator projection has straight lines for constant bearing courses. You'd spiral around the north pole infinite times, and the line on the Mercator projection is infinite, but I suspect the actual distance is finite. I haven't tried to calculate that at all.
For a sphere of radius $1$ centered at the origin in $\mathbb R^3$, you get a curve \begin{align*} x(t) &= \frac{\cos t}{\sqrt{\sinh^2 t + 1}}, \\ y(t) &= \frac{\sin t}{\sqrt{\sinh^2 t + 1}}, \\ z(t) &= \frac{\sinh t}{\sqrt{\sinh^2 t + 1}}, \\ \end{align*} with time $t\in[0,\infty)$.
This curve has finite length $$ L = \int_0^\infty \sqrt{\dot x(t)^2+\dot y(t)^2+\dot z(t)^2}\,\mathrm dt = \frac{\pi}{\sqrt 2}. $$
Multiply by the radius of the earth to obtain the real length of the trip.