write to code without prefix table name
That behaviour is hard-coded with a SelectQuery; the prefix will apply to all tables, without exception, and there's no mechanism in place to override it. It happens in SelectQuery::__toString() if you're interested.

If you want to change that, you'll need to subclass SelectQuery, add a mechanism to let the class know which tables should/shouldn't be prefixed, and override the __toString() method to take that into account. Then you'll need your own version of db_select(), which uses your new custom version of the class.

All that's probably not worth the effort given that you can run an arbitrary SQL string with db_query(). For example, the following won't attempt to prefix custom:

db_query('SELECT * FROM custom c')