The "check" option of compact(), TRUE by default, is per ?compact just passed on to "slot<-". The "slot" help says:
check In the replacement version of slot, a flag. If TRUE, check the assigned value for validity as the value of this slot. User's coded should not set this to FALSE in normal use, since the resulting object can be invalid.
but compact() is not really user code, and presumably knows what it assigns? Seems more like a debug option that can maybe be disabled once this has been tried out with a type of object? Background: compact(obj) seems to take ~1s for an obj with a lot of hidden stuff, and I'm doing it many times, so I'm wondering whether this would be an easy way to shave off some runtime.
I think it's safe in this circumstance to set it to FALSE; this is likely a significant speed-up.