Running through CLI
I need to do this because adding a huge number of pages (migrating old data) through the API takes A LOT of time when run through the web server, while takes a fraction of that time when run with CLI.
That being said, the OP is asking how to do this stuff WITHOUT running through the web server, which I don't think is possible. @okhayat, perhaps a different solution would be to run on a faster web server -- set up a C5 installation on a fast VPS with opcode caching, etc., then when things are imported just dump the database and /files/? Maybe you're already doing that, but that's the only solution I can think of.