try
curl http://foo.com/script.sh | bash -s arg1 arg2
bash manual says:
If the -s option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an interactive shell.