Path2D has a Curve2D, basically it's an array of points so
To draw the line you can use in the
_draw () function:
draw_polyline ($ Path2D.curve.get_baked_points (), Color.aquamarine, 5, true)
Remember to use
update () every time you change any properties of the curve, so that it is updated.
To change position each point look at the curve functions in the help, among other things you have this function:
void set_point_position (idx: int, position: Vector2)
Sets the position for the vertex idx. If the index is out of bounds, the function sends an error to the console.
See Curve2D in godot's help to see all the features.