Let's take a closer look at the specific case that you use as an example: performing integration to arrive at an expression for potential energy.
The thing with potential energy: potential energy doesn't have an intrinsic zero point. In any calculation that you do you are evaluating a difference in potential. In that sense the choice of zero point is arbitrary.
In the case of elastic potential energy of a spring there is a natural choice of point of zero potential: the relaxed state of the spring. But still, no self-contradiction will arise if you assign as potential a non-zero value 'c' to the relaxed state of the spring. Then when you assign a numerical value (for elastic potential energy) to a particular shortened/elongated state of that spring you add that same value 'c' that you assigned to the relaxed state of the spring.
In any calculation: what you use is the difference in potential energy between two states of the spring, so that factor 'c' will always drop out of the calculation.
Here is a case where the choice of zero point is a bit tricky: gravitational potential energy.
One may be tempted to do the following: take two objects, and call the state where the two objects have merged the state of zero potential gravitational energy. Then you can assign a potential to every state where the two objects are at some distance to each other.
The problem with that: if you treat the two gravitating bodies as point masses then they can come arbitrarily close to each other. Gravity is an inverse square law; when the distance becomes infinitely small the force becomes infinitely large. So: mathematically the integration fails: you cannot integrate all the way to distance zero.
The above infinity problem is evaded in the following way: in the case of an inverse square force such as gravity the value of zero potential is put at infinitely far away from each other.
As two objects are gravitationally attracted to each other they accelerate towards each other. They are moving down the gravitational potential, and gravitational potential energy is transformed to kinetic energy.
Between any two distances what is relevant to you is the difference in gravitational potential energy. All you ever use is difference in gravitational potential energy between distance A and distance B. That is why you have freedom to choose where you put the point of zero potential energy.
As two objects accelerate towards each other, accelerated by gravity, the value of the potential energy you assign is a negative value. Can potential energy be negative? Again: that negative value doesn't have an intrinsic meaning. The difference in gravitational potential between some point A and some at larger distance point B is a positive value.
All you ever use is difference of potential energy between two states.
All cases where integration is done, and the integration constant is ignored, are cases where (like potential energy) you are using a difference; a difference between two states. So any integration constant that you add will drop out of the calculation anyway.