Painting sometimes is slower than before my changes, probably because of too
many RNA queries?
I'd suggest to profile that and see if RNA is indeed the problem; if
so you could do something similar to what sculpt mode does and create
a cache for values. (Of course, if multiple modes have such
0.01 sounds fine to me as long as there are no negative side effects;
like making fast moving objects more susceptible to breaking through the
ground or other objects, increasing physics calculation times, or some
other such thing. I've personally always thought the default margin of
0.06 was