Set DDR and PORT registers based on pin number (AVR)?
I'm probably not the most qualified to answer, but I'll compile what folks have said thus far.

From Chris Stratton:


  Generally speaking, that's a bad idea. Use the logical port
  assignments, and if you want, #define them by radio function. If you
  really want to see what a user pin abstraction introduces in terms of
  complication, look at Arduino core code where they do that.


From Harry Svensson:


  There's a lot of code happening during runtime rather than compile
  time. Runtime code will consume precious EEPROM memory. You definitely
  need to make use of #ifdef together with #define if you want to
  unclunky-fy your code. Since they are only evaluated during compile
  time.


And from Lundin:


  There is no reason to set it "based on the physical pin number". You
  need to ask yourself why you need the pin numbers to be variable in
  relation to the ports. Do you expect Atmel to suddenly remap the
  ports? Do you need the code to be portable to another package at the
  same time as you need operations based on pin number? If not, then you
  are just inventing artificial requirements and doing meta programming.
  Just hardcode the port setup or #define all the constants. Toggling
  DDR in runtime, rather than just setting it up once, is quite a rare
  case too, do you actually need to do that?


Seems like the best way to approach it is with preprocessor commands, e.g. #ifdef, #define, and so on.  Since I'm only using a single IC there's no need to waste memory on code portability.