ENH: support for --foo=~/bar

One thing that has always frustrated me with `optparse` is that `~/` is not handled. This light PR is one approach to supporting `~/`, though it wasn't clear to me if this was the best place in code to handle it