Originally was noticed when adding drivers to a rigid body., but
it could potentially happen with any configuration.
The reason for the crash was that the ID which was modified was
not tagged as such.
Modifying drivers from the interface are likely tagging for updates
from the operator. This change makes it so the python function also
does tagging.
It is not really how one would design the system nowadays, but it
is how the Blender historically handles such cases. A bigger refactor
is possible to move tags to the places where modification actually
happens, but it seems to be a better idea to tackle it as a separate
project which will be considered no-functional-changes.