If you wish to move all of a user’s items (and groups) to another user then use the user.reassign_to() method. This method only moves one item at a time.
This doesn't work if literally any single item is shared to specific groups. A user can assert ownership if it is shared to a group. If all of the groups and items are being transferred, why is this a block? What is a solution that doesn't involve unsharing to all groups, transferring, then reapplying the same sharing properties?