As a general rule, 2 accesses via index or hash is the limit of how many times I'll touch a variable before I decide to rewrite an pull it into a local one and all accesses are from the local one that moment forward.

Also, some languages do reference by default so variables are modifiable and can be broken by accident, so some programmers get into the habit of doing a local copy for safety.