The workaround for this patch was to force the undo type/context of the buttons to be BKE_UNDOSYS_TYPE_MEMFILE.
I don't know what impact this has on memory, but usability has been greatly improved in several ways.
In addition to T61948 this patch also benefits T62450 since the undo now re-displays the visibility of hidden objects.