Eu não acho que você possa. Eu acho que é uma limitação de como o Ksh interroga o ambiente ao procurar o escopo de uma variável.
trecho de Escopo das variáveis no KSH
Ksh has dynamic scoping, so the variable is also accessible in functions that are invoked by the function that declares the variable. This is tersely documented in the section on functions in the manual. Note that in AT&T ksh (as opposed to pdksh and derivatives, and the similar features of bash and zsh),
excerto Parâmetros: uma visão geral
When you read or set a variable, zsh looks in the current function to see if that variable exists. If not, it looks in the next outermost function, and so on, until it reaches the global (outermost) scope. Therefore, if you assign a value to a variable that doesn't exist, the variable gets created in the outermost scope. (Exporting a new parameter also has this effect.)