It makes sense to unset an environment variable or set it to an empty value. Therefore, this should not fail but result in the setting of an empty value (VARNAME=).
Possible solutions:
extra code to allow/disallow empty values
always request a value, but handle empty values with Optional instances (None = empty value.)
This is a bug in the GenericMethod class