When the object materials array is already the correct size these functions don't do anything. Avoiding the depsgraph tags can avoid unnecessary re-evaluations in cases like sculpt mode where we purposefully avoid adding tags elsewhere. Split from !133842.