Is there a way to deal with artifacts appearing in texture painting? I noticed that if I start painting a 3d model, after a while some "white spots" artifacts start to show up, and they become more and bigger the more times I pass a brush on top of them.

Here is the kind of artifact I'm talking about: 


What I've noticed is this: Painting on the model directly through texture paint mode doesn't allow you to paint in the whole "image" of the texture that is being produced as you paint. In fact, the brush doesn't even paint on some pixels of the texture file that the UVs are laid on.
Check this image:



You can clearly see that part of the UV is laid on a part of the texture image that is white. And it's white because the brush can't paint on there.

Is there a way to avoid this artifact happening at all ? If not, is there an easy way to fix it, other than examining the texture pixel by pixel ? A texture can have millions of pixels, and it's like a fool's errand to try to "hunt" for bad pixels on the actual texture.
If a texel (texture pixel) is only partially covered by the UV shell, you can get this sort of error. You can see it happening in the second image. Blender has to guess whether to apply the texture or not, since it isn't clear from the UV map. To deal with this, texture paint has a function called &quot;bleed&quot; that will spray a little bit past the UV edge. It's located in the &quot;options&quot; tab of the T-panel while in texture paint mode:

When your brush crosses the edge of a UV shell, this will spray extra paint beyond the edge to pad this &quot;vague&quot; boundary of texels that are partially occupied by the UVs. The setting is how many pixels of padding it will make, here's some examples

Your issue is caused by either no bleed, or setting the number of bleed pixels too low.
You do need to make sure you have some amount of space between each UV shell, otherwise the padding for one UV shell will run onto a nearby UV shell.