What's a good way to be hardware independent?

I'm asking if there's a buried macro or trick that anyone knows of that can allow passing (full or partial) PORTS as parameters.

Try looking up digitalwritefast:

http://code.google.com/p/digitalwritefast/

That uses a compile-time trick to map, where possible, digital writes of constants to a direct port, removing the runtime lookup.