Should I replace a 50A oven breaker with a 40A breaker if that's adequate?
First of all, note that if your current wiring is in good condition, you don't need to remove it to install a 4 wire cable.  Instead, you can retrofit a ground by using an appropriately sized wire (depending on your breaker choice), running along any route you please, that connects the stove to the panel it's served from, or to any ground wire at least that big that goes to that service panel (i.e. the wire from your ground rods).
As far as the breaker size, check your new range's instructions: if they say it requires a 40A breaker, then yes, you need to change it to that.  If instead it says you must use a minimum of a 40A breaker, it should also list a maximum (which will almost certainly be 50A), and in that case you're free to use either.
As far as the wire size, you could downgrade to a lower gauge if you're using a 40A breaker, but since you already have 3 of the 4 wires sized for 50A, personally I'd recommend sticking with the current 50A wire and adding a 50A ground wire as well -- that way if you (or whoever buys your house someday) wants a more powerful range in the future, you'll be ready.  It's always allowed to use bigger wire, so putting wire that's good for 50A on a 40A breaker is no problem.