smart coding possible?
If all are handled the same and they don't have individual names, arrays and for loops are what you are looking for.

const byte relayPins[] = { A5, A4, A3, A2, A1, A0};
const byte ledPin = 3;
const byte swPins[] = {5, 6, 7, 8, 9};

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
  for (const byte relayPin: relayPins) pinMode(relayPin, OUTPUT);
  for (const byte swPin: swPins) pinMode(swPin, INPUT_PULLUP);
}


Even arduino C++ nowadays understands the foreach syntax.

BTW: for your final pin count you'll need other/additional hardware. Either a Mega or shift registers or port expanders.