Writing to multiple pins with a single command?

Hi all!
My project is a vehicle light system, turn indicators, brake lights and such, and my solution revolves around pin extender IC chips, MCP 23008 and 23017 to be specific, controlled by a arduino nano.

The pin extenders are all tucked away inside a pre-existing housing, rear light, front light, trailer and handlebar and each extra light (turn indicators and so on) and button (functions) connects to the appropriate breakout card, rear turn indicator connects to the rear light pin extender card and so on.

This means i have up to 5 different output pins for each "function" as well as a few duplicate input pins.

Currently im using multiple digitalWrite´s, one for each output pin, but that creates a LOT of code lines.

I would like to define my functions with a list of function pins, something like:

leftTurn = frontLeftPin, rearLeftPin, trailerLeftPin, arduinoLeftPin

and use it like:
digitalWrite(leftTurn, leftState).

I would also like to define hazard lights in similar manner, like
hazLights = leftTurn, rightTurn, brakeLights
digitalWrite(hazLights, hazLightState)

Now the question is, how is this done?
Is it even possible?

I have gathered that arrays would kind of solve it, to have a repeat that steps thru each pin to toggle it, but it doesnt seem to allow me to set all array items at the same-ish time and i havent found a way to call multiple arrays, to call both right and left turn indicators for hazard lights.
In any way, i kind of dont like the array solution, it somehow feels wrong for this application..

I havent actually studied any programming, just trying to understand from examples and web tutorials so please treat me as newbie, even if this project is a bit over newbie-level.

leftTurn = frontLeftPin, rearLeftPin, trailerLeftPin, arduinoLeftPin

That certainly sounds like an array to me.

You could have different arrays for each state such as leftTurnPins[], rightTurnPins[] and hazardPins[] each containing the relevant pins. It does not matter if a pin appears in more than one array. Then create a function for each state that uses a for loop to set each of the pins in the array to the required state. Call the relevant function when required and the pins will be set to the required state.

You should read up on direct port manipulation, for example, turn pins 8, 9 and 10 on at the same instant:

PORTB |= 0b00000111;

To turn off:

PORTB &= ~(0b00000111);

outsider:
You should read up on direct port manipulation, for example, turn pins 8, 9 and 10 on at the same instant:

PORTB |= 0b00000111;

To turn off:

PORTB &= ~(0b00000111);

I suspect that will be a difficult technique to use in these circumstances due to the combinations required but the OP may be lucky.

I was thinking about something like this:

uint32_t ltFlashStart, rtFlashStart;
int ltFlashEnd = 500, rtFlashEnd = 500;
byte leftLights = 0b00000111; // pins 8,9,10
byte riteLights = 0b00111000; // pins 11,12,13
byte ltSwitch = 4, rtSwitch = 5;
bool ltTiming = false, rtTiming = false;

void setup(){
  DDRB = 0b00111111;
  pinMode(ltSwitch, INPUT_PULLUP);
  pinMode(rtSwitch, INPUT_PULLUP);
}

void loop(){
  if(!digitalRead(ltSwitch))
    leftTurn();
  else
    PORTB &= ~(leftLights);
  if(!digitalRead(rtSwitch))
    riteTurn();
  else
    PORTB &= ~(riteLights);  
}

void leftTurn(){
  if(!ltTiming){
    ltFlashStart = millis();
    ltTiming = true;
  }  
  if(millis() - ltFlashStart < ltFlashEnd)
    PORTB |= leftLights;
  else
    PORTB &= ~(leftLights);
  if(millis() - ltFlashStart > ltFlashEnd * 2)
    ltTiming = false;
}
void riteTurn(){
  if(!rtTiming){
    rtFlashStart = millis();
    rtTiming = true;
  }  
  if(millis() - rtFlashStart < rtFlashEnd)
    PORTB |= riteLights;
  else
    PORTB &= ~(riteLights);
  if(millis() - rtFlashStart > rtFlashEnd * 2)
    rtTiming = false;
}

Would it not work?