Wonder, is there a function or an addon in blender that puts selected vertexes connected with edges into a straight line between the vertexes at the ends?

One option is the Relax function of the Loop Tools addon with linear interpolation and full iterations. You mad need to do Shift+R a couple of times to repeat. This will not keep the relative positions of the vertices

You could create a temp edge between the points and use snap to edge.

i use the mirror mod with clipping then turn clipping off

Vertex Align addon