No. It is not okay to skip the slash. It may work in a modern browser. However, that does not make it correct.
See RFC1738 - URL and
RFC2396 - URI.
The format per RFC1738 (I have excluded the schema format here):
//<user>:<password>@<host>:<port>/<url-path>
And it goes on to note that: """...the "/" between the host (or port) and the url-path is NOT part of the url-path.""".
In this case the "?" is part of the url-path which """...depends on the scheme being used, as does the manner in which it is interpreted."""
Also note that, per specification, it is perfectly valid to omit "/url-path" -- note that the "/" has been explicit included in this case.
Thus, foo.com?bar is invalid because there is no "/" before the url-path.