Move a few invariants out of loop.
getSecurityUidDictAndRoleColumnDict micro-optimisation

try..except is significantly slower than getattr with default value when
an exception is raised.
defaultdict is faster than calling setdefault.
The two other try..except blocks need more careful analysis of typical
hit-rates to tell if they are optimal.
Drop unused variable.
Move more code inside cached function.
Provide a way to ignore arbitrary security columns in worklist cache.