You would need a script traversing (or using the catalog) objects for local roles and ownership and check if the user is assigned, remove the role/ownership (assign ownership to a different user) and do a reindexObjectSecurity. While this is feasible with small sites, for larger sites this probably takes ages. So using UIDs as userids is the better solution.
[that said, with my new approach, having a queryable ZODB and catalog this could be done on SQL level relatively fast, but this does not help you now]
Remove the user from all the groups before deleting? You've to hook in the user deletion event to delete the user from the group. Roles are assigned by groups, usually.
If you assign roles directly, disable the user and periodically delete disabled users from object security and then remove the users. In the mean time, "same-user" cannot be assigned.
It would be nice (for my user cases) removing a user also did this.
(alternatively: an option on delete to ‘purge some properties’.
For site in question: I dont think they use ‘local permissions/roles’,maybe I can use "Products.PluggableAuthService.interfaces.events.IPrincipalDeleted (if it does not fire before they are deleted) . Or maybe ‘user Folders’ can be used ‘somehow’ (I dont know if user-folders are deleted/modified when a user is removed.