New PyQGIS API has been added to make it easy to retrieve a substring from a LineString/Curve geometry:
QgsCurve::curveSubstring - Returns a new curve representing a substring of a curve, from a start distance and end distance.
If z or m values are present, the output z and m will be interpolated using the existing vertices' z or m values. The method also handles curved geometries without loss or segmentation.