I am trying to understand the step going from
- Having a serial of points projected on an arbitrary straight line
$C, D, E, F, G \rightarrow C', D', E', F', G'$
and $M$ the medium point of $C,D,E,F,G$ projected on $M'$
- Finding the best straight line that will maximize the sum of the distances between:
$M'$
and the other projected points $C', D', E', F', G'$
What is the principle of the action that I am called to do to succeed?
I understand that I will change the $\overrightarrow{AB}$ vector,
but how?
(P.S.: my question hasn't accurate tags: I'm lacking knowledge to classify it)

Obviously, the maximum depends on AB's direction but not position, i.e. if we represent AB as $y=kx+b$, it only depends on k but not b.
For example, for
C, D, E, F, G = (14.1, 4.3), (4.2, 4.8), (8.8, 8), (9.7, 0), (14, 3.3): if AB is parallel to x-axis, we get $|M'C'|+|M'D'|+|M'E'|+|M'F'|+|M'G'|=15.56$ (take x only); if AB is parallel to y-axis, we get 9.72 (take y only).Note that if we project point $(x_0, y_0)$ onto $y=kx$, we get $\left(\dfrac{x_0+ky_0}{1+k^2},\dfrac{k(x_0+ky_0)}{1+k^2}\right)$.
So we can rotate AB and find the maximum. Here is the numeric solution by Python:
When AB is $y=-0.6339x$, the maximum sum is 17.3334.
Here's it's an edit of me (Marc), the opener of the question:
I've added to your response my figure with the straight line in orange coming from your calculations:
$y = -0.6339x + 5$
(I've chosen $b=5$ as $b$ value has no effect on the distances of the projected points, like you wrote).
My own line shown roughly (I measured it with a ruler) points summarizing a distance between their projection and $M'$ of
$d(C',M') + d(D',M') + d(E',M') + d(F',M') + d(G',M') = (2.7 + 1.1 + 0.2 + 1.5 + 1.8) \times 2^{*} = 14.6 \text{ units}$
$^{*}$ my ruler measures centimeters and a square on the paper is 0.5 cm long. So I have to multiply by 2 to return to graph units.
Your solution gives me:
$d(C'',M'') + d(D'',M'') + d(E'',M'') + d(F'',M'') + d(G'',M'') = (2.2 + 1.5 + 1 + 1.1 + 1.8) \times 2 = 15.2 \text{ units}$
It's possible that the measurements I've done manually here explain the gap of few units between your result and the one I red on my paper for your calculated straight line.
If I had done everything by calculation, and reported the points on a larger figure, I would have had less errors. Thanks for the explanation: I will study it carefully.