Yes single quotes are unnecessary as we pass the username and password to curl surrounded in double quotes already.
curl -u "username:password"
I am surprised that a $ needed to be escaped since we do pass it in the double quotes. We will have to look into what characters are special and escape them automatically if possible.