add a way for io.ascii set how masked values appear on output

Alternative implementation for #2255

Still missing: Changelog, documentation.

I just want to check that this passes for all versions of numpy before I add that.
CC: @taldcroft