In POSIX sh you may set options with set:
#!/bin/sh set -u; echo "$notset";
that gives expected:
parameter no