[ -z $var ] works unreasonably well
My rule is that shell scripts with growing complexity must be converted to a language with clearer and more bulletproof treatment of data, like Python.  This also happens any time I want to support several command line arguments.At one point in history, options were more limited.  Now, it is just not worth the time to read code that may or may not have obscure errors in its very expressions that you must understand before you can even begin to examine the real purpose of the program!