Given triangle $ABC,$ there exists a unique point $P$ such that
\[AB^2 + AP^2 + BP^2 = AC^2 + AP^2 + CP^2 = BC^2 + BP^2 + CP^2.\]Express the common value above in terms of the side lengths $a,$ $b,$ and $c,$ and circumradius $R$ of triangle $ABC.$
From the equation $AB^2 + AP^2 + BP^2 = AC^2 + AP^2 + CP^2,$
\[AB^2 + BP^2 = AC^2 + CP^2.\]Then
\[\|\overrightarrow{A} - \overrightarrow{B}\|^2 + \|\overrightarrow{B} - \overrightarrow{P}\|^2 = \|\overrightarrow{A} - \overrightarrow{C}\|^2 + \|\overrightarrow{C} - \overrightarrow{P}\|^2,\]which expands as
\begin{align*}
&\overrightarrow{A} \cdot \overrightarrow{A} - 2 \overrightarrow{A} \cdot \overrightarrow{B} + \overrightarrow{B} \cdot \overrightarrow{B} + \overrightarrow{B} \cdot \overrightarrow{B} - 2 \overrightarrow{B} \cdot \overrightarrow{P} + \overrightarrow{P} \cdot \overrightarrow{P} \\
&= \overrightarrow{A} \cdot \overrightarrow{A} - 2 \overrightarrow{A} \cdot \overrightarrow{C} + \overrightarrow{C} \cdot \overrightarrow{C} + \overrightarrow{C} \cdot \overrightarrow{C} - \overrightarrow{C} \cdot \overrightarrow{P} + \overrightarrow{P} \cdot \overrightarrow{P}.
\end{align*}This simplifies to
\[ \overrightarrow{B} \cdot \overrightarrow{P} - \overrightarrow{C} \cdot \overrightarrow{P} + \overrightarrow{A} \cdot \overrightarrow{B} - \overrightarrow{A} \cdot \overrightarrow{C} + \overrightarrow{C} \cdot \overrightarrow{C} - \overrightarrow{B} \cdot \overrightarrow{B} = 0.\]We can factor this as
\[(\overrightarrow{B} - \overrightarrow{C}) \cdot (\overrightarrow{P} + \overrightarrow{A} - \overrightarrow{B} - \overrightarrow{C}) = 0.\]Let $D$ be the point such that $\overrightarrow{D} = \overrightarrow{B} + \overrightarrow{C} - \overrightarrow{A},$ so the equation above becomes
\[(\overrightarrow{B} - \overrightarrow{C}) \cdot (\overrightarrow{P} - \overrightarrow{D}) = 0.\]This means lines $BC$ and $PD$ are perpendicular.  In other words, $P$ lies on the line through $D$ that is perpendicular to line $BC.$

From $\overrightarrow{D} = \overrightarrow{B} + \overrightarrow{C} - \overrightarrow{A},$
\[\frac{\overrightarrow{A} + \overrightarrow{D}}{2} = \frac{\overrightarrow{B} + \overrightarrow{C}}{2}.\]In other words, the midpoints of $\overline{AD}$ and $\overline{BC}$ coincide, so $ABDC$ is a parallelogram.

Similarly, if $E$ is the point such that $AECB$ is a parallelogram, then we can show that $P$ lies on the line passing through $E$ that is perpendicular to line $AC.$  Thus, the location of point $P$ is uniquely determined.

[asy]
unitsize(0.5 cm);

pair A, B, C, D, E, F, H, O, P;

A = (2,5);
B = (0,0);
C = (7,0);
D = -A + B + C;
E = A - B + C;
F = A + B - C;
H = orthocenter(A,B,C);
O = circumcenter(A,B,C);
P = 2*O - H;

draw(A--B--C--cycle);
draw(B--D--E--A);
draw(interp(P,D,-0.2)--interp(P,D,1.2),dashed);
draw(interp(P,E,-0.2)--interp(P,E,1.2),dashed);

label("$A$", A, N);
label("$B$", B, SW);
label("$C$", C, SE);
label("$D$", D, W);
label("$E$", E, SE);
dot("$P$", P, NW);
[/asy]

Taking the circumcenter of triangle $ABC$ as the origin, we can write
\[\overrightarrow{H} = \overrightarrow{A} + \overrightarrow{B} + \overrightarrow{C},\]where $H$ is the orthocenter of triangle $ABC.$  Note line $AH$ is also perpendicular to line $BC,$ so
\[\overrightarrow{P} - \overrightarrow{D} = t(\overrightarrow{H} - \overrightarrow{A}) = t (\overrightarrow{B} + \overrightarrow{C})\]for some scalar $t.$  Then
\begin{align*}
\overrightarrow{P} &= \overrightarrow{D} + t (\overrightarrow{B} + \overrightarrow{C}) \\
&= \overrightarrow{B} + \overrightarrow{C} - \overrightarrow{A} + t (\overrightarrow{B} + \overrightarrow{C}).
\end{align*}Similarly,
\[\overrightarrow{P} = \overrightarrow{A} + \overrightarrow{C} - \overrightarrow{B} + u (\overrightarrow{A} + \overrightarrow{C})\]for some scalar $u.$  Note that we can take $t = u = -2,$ which gives us
\[\overrightarrow{P} = -\overrightarrow{A} - \overrightarrow{B} - \overrightarrow{C}.\]Therefore, the common value is
\begin{align*}
AB^2 + AP^2 + BP^2 &= \|\overrightarrow{A} - \overrightarrow{B}\|^2 + \|\overrightarrow{A} - \overrightarrow{P}\|^2 + \|\overrightarrow{B} - \overrightarrow{P}\|^2 \\
&= \|\overrightarrow{A} - \overrightarrow{B}\|^2 + \|2 \overrightarrow{A} + \overrightarrow{B} + \overrightarrow{C}\|^2 + \|\overrightarrow{A} + 2 \overrightarrow{B} + \overrightarrow{C}\|^2 \\
&= \overrightarrow{A} \cdot \overrightarrow{A} - 2 \overrightarrow{A} \cdot \overrightarrow{B} + \overrightarrow{B} \cdot \overrightarrow{B} \\
&\quad + 4 \overrightarrow{A} \cdot \overrightarrow{A} + \overrightarrow{B} \cdot \overrightarrow{B} + \overrightarrow{C} \cdot \overrightarrow{C} + 4 \overrightarrow{A} \cdot \overrightarrow{B} + 4 \overrightarrow{A} \cdot \overrightarrow{C} + 2 \overrightarrow{B} \cdot \overrightarrow{C} \\
&\quad + \overrightarrow{A} \cdot \overrightarrow{A} + 4 \overrightarrow{B} \cdot \overrightarrow{B} + \overrightarrow{C} \cdot \overrightarrow{C} + 4 \overrightarrow{A} \cdot \overrightarrow{B} + 2 \overrightarrow{A} \cdot \overrightarrow{C} + 4 \overrightarrow{B} \cdot \overrightarrow{C} \\
&= 6 \overrightarrow{A} \cdot \overrightarrow{A} + 6 \overrightarrow{B} \cdot \overrightarrow{B} + 2 \overrightarrow{C} \cdot \overrightarrow{C} + 6 \overrightarrow{A} \cdot \overrightarrow{B} + 6 \overrightarrow{A} \cdot \overrightarrow{C} + 6 \overrightarrow{B} \cdot \overrightarrow{C} \\
&= 6R^2 + 6R^2 + 2R^2 + 6 \left( R^2 - \frac{c^2}{2} \right) + 6 \left( R^2 - \frac{b^2}{2} \right) + 6 \left( R^2 - \frac{a^2}{2} \right) \\
&= \boxed{32R^2 - 3(a^2 + b^2 + c^2)}.
\end{align*}