You don't gain anything using an opto, because it's low voltage and common ground. You could do the same thing with discrete transistors (2N3904, etc.) though.
If you use an NPN then a PNP, cascaded, each in common-emitter configuration, then you get a 12V output with a hard pull-up (faster turn-on) and a resistor pull-down (slow). The logic is noninverting. The resistor can be improved with a PNP emitter follower (connect a diode from pull-up transistor collector to gate, to shunt turn-on current around the emitter follower).
You could skip the PNPs, and then you have slow pull-up (resistor) and hard pull-down (NPN collector), but inverting logic (so you have to modify your PWM generator to go from MAXVAL-1 to 0, instead of 0 to MAXVAL-1). And use an NPN emitter follower to improve turn-on (same idea, put a diode from gate to collector).
This only uses two transistors, which is about as much bother as the opto IC. They can be duals (e.g. BC847BD) if you're into that sort of thing.
You can also do it noninverting, with a slight reconfiguration. Instead of common-emitter (emitter grounded, resistor divider from logic input to base to GND), common-base can be used (resistor divider from +V to base to GND, logic input to emitter). This forces load current through the MCU pin, so has the same limitations mentioned above -- but as long as this current is limited to, say, 20mA (say by crudely limiting base current to ~0.2mA, or using a series gate resistor), it's not a problem.
And again, logic level FETs are an option, certainly for 5V. IRFL44 say? If your Arduino is 3.3V, that's harder, but there are a few options even for that, now.
Tim