AppleScripts vs Shell Scripts

There is no native AppleScript method to get environment variables that contain non-ASCII characters.

system attributes does not work properly for environment variables that contain international characters.

do shell script "echo $KMVAR_My_KM_Variable" does.

as does

tell app "Keyboard Maestro Engine" to getvariable "My KM Variable"

It is far from clear which of the latter two would be faster. One involves interprocess communication via AppleEvents (which is extremely slow), and the other involves firing off a sub-process (which is extremely slow). Where by “extremely slow” I mean compared to reading an environment variable.

Without profiling all of them, I would have no idea which one would be fastest - but I do know which of the three wont work with international characters in the variable.