Since top level definitions should be immutable we should be blocking users from creating variables using var or let at the top level. Probably just throwing a clear error is the solution.
The example which brought this up is:
let str = '';
for (let i = 0; i < 9; i++) {
str = str + i;
}
console.log(str);