A quick way to do that is:
An inconvenience with the above code is that it also factorizes some of the variables :
-(p1 - p3)^2 x2 x3 + x1 (-p1^2 x2 - p3^2 x3)
If you prefer that the code only simplifies the coefficients, a solution is to take a symbol without an assigned value, say g, then enter the code (see footnote *tip below for a tip):
If you are looking for speed, at least for the example you gave, the code above is about 3 times faster than the one provided by @user293787 on my computer.
*tip: to be sure that the symbol will not be assigned a value in the future, you can use
(type the Esc key then the $ key or . key then g (or another letter) then the Esc key again ).
\[FormalG] is protected by default so it will not be assigned a value (maybe unless someone uses Unprotect but I have personally avoided using Unprotect)