This can be done in Geometry nodes easily:

You can create this geometry nodes tree and use it in Python, or you can create it dynamically in Python. I think it's reasonable, because finding out the position of the points is a computationally expensive process (basically trial-and-error), which multiplied by thousands of segments probably would end up too expensive in Python - meaning that the overhead of evaluating the depsgraph and the object is likely worth it.
from bpy import context as C, data as D
ob = C.object
mod = ob.modifiers.new(name="Temp geonodes modifier", type='NODES')
tree = D.node_groups.new("Temp geonodes tree", 'GeometryNodeTree')
tree.inputs.new('NodeSocketGeometry', 'Geometry')
tree.outputs.new('NodeSocketGeometry', 'Geometry')
node_in = tree.nodes.new(type='NodeGroupInput')
node_ctp = tree.nodes.new(type='GeometryNodeCurveToPoints')
node_ctp.mode = 'LENGTH'
node_ctp.inputs['Length'].default_value = 0.2
tree.links.new(node_in.outputs[0], node_ctp.inputs['Curve'])
node_ptv = tree.nodes.new(type='GeometryNodePointsToVertices')
tree.links.new(node_ctp.outputs['Points'], node_ptv.inputs['Points'])
node_out = tree.nodes.new(type='NodeGroupOutput')
tree.links.new(node_ptv.outputs['Mesh'], node_out.inputs[0])
mod.node_group = tree
dg = C.evaluated_depsgraph_get()
ev = C.object.evaluated_get(dg)
me = ev.to_mesh()
print("Coordinates:", *[v.co for v in me.vertices], sep="\n")
ob.modifiers.remove(mod)
D.node_groups.remove(tree)