Use COPY table TO ... WITH BINARY which is according to the documentation is "somewhat faster than the text and CSV formatsis somewhat faster than the text and CSV formats." Only do this if you have millions of rows to insert, and if you are comfortable with binary data.
Here is an example recipe in Python, using psycopg2 with binary inputexample recipe in Python, using psycopg2 with binary input.