pinMode(PIN,OUTPUT) Setting PIN LOW

Can I check this.
Using pinMODE(B5,OUTPUT) drives the B5 LOW even if I have included a digitalWrite(B5,HIGH) immediately before it. I have verified this with a scope. If it is actually is coded that way it presents problems which cannot be fixed with tying the output high with a resistor so that the line is not dropped during start up or reset. Obviously I can follow the mode command with the write command but this still introduces a drop on the line of a few microseconds which can create issues.
Most micros allow setting the pin high before changing to an output which ensures that there is no glitch on the line.
Am I wrong with the Electron or is there a way around this? My guess is that the mode command actually forces the output low for safety but I feel this should not be done.
Thanks

I guess this is due to the fact that digitalWrite() does do a sanity check whether the desired pinMode() is already selected and just bails out if not.

Try digitalWriteFast() or pinSetFast() instead. These have no such sanity checks in place.