The reason for the default is because the original code used the type of the active object, and this default specifically implements it. I'd suggest not changing it without consulting with whoever actually wrote the actual original code.
The original (unimplemented) design was to implement a WEIGHT_PAINT mode for the bones as well. To stop this mess of having two edit objects in different modes. What we would have is both armature and mesh object in weight mode.
So although this patch provides a fix, it deviates the code even further from that design.
Anyways, this patch seems to be a valid quick fix. An improvement from what we have in master anyways.
That said I would rather -1 as argument to FOREACH_BASE_IN_MODE_BEGIN to use a define (e.g., ANY_MODE) instead of -1.
@Campbell Barton (campbellbarton) what do you say? Is the whole weightpaint mode for armature still a thing?