As others have stated. The reason that the path taken is IRRELEVANT in electrostatics, is that the electric field can be written as $-\nabla V$. When a function can be written as the gradient of a scalar function, the line integral is path independant. This is an example of a Conservative field, where $\nabla × F = 0$$\nabla × \vec{E}= 0$
For a formal proof, see my answer here, Proving if a force is conservative and non-conservative
Solving the equation
$\vec{E} = -\nabla V$
For V, yields the standard potential function.( can also be done using maxwells equations themself)