> Because the duration is so dependent on the program, and the only end is when the advisor agrees that sufficient work has been done to merit a PhD, it can stretch on without much hope in sight.
At least one world famous research university has a fix for this problem of "... when the advisor agrees":
The official statement of the university is that the Ph.D. student must submit "an original contribution to knowledge worthy of publication".
So, if a student believes that they have done such work, then they are free to, and maybe should, submit it for publication. When the work is accepted for publication, the student can then so announce to the professor, department school, and university.