Ported point_along_segment(), Polyline::length(), Polyline::clip_end() to XS