Uno and 4-ohm speaker

You require a 220 Ohm resistor in series with the Arduino pin to limit the current to a safe level.

If you think this will severely restrict the output volume you are dead right! This also means you have no concerns whatsoever about DC bias on the speaker.

You would be better off using 50 Ohm earphones - still with the same resistor and with a capacitor in series as well.

For audio, you need a PWM frequency exceeding 20 kHz.