There are two opposing requirements for the resistor here:
1) It should be big enough to limit inrush current as much as possible.
2) It should be small enough not to affect normal circuit operation, or dissipate too much power.
Usually #2 is practical limit.
According to Ohm's law, if 40mA is passing through a 4.7 ohm resistor, the voltage drop across it will be 0.188V. And the power dissipated through it will be 0.04*0.188, or 7.52mW. That was actually much less than I intended, so I must have made a math error the first go round.
For Venkadeshm's larger 50 ohm resistor, it's a 2V drop, and 80mW. Still acceptable, the resistor might just get a little warm, and your circuit can tolerate the 2V drop.
You mentioned surge resistors earlier, they do exist, and are called inrush limiters or NTC thermistors. They start at a high resistance when cold, and resistance drops as they heat up, causing them to have less impact on the circuit once it's up and running. The ones I've personally seen seem to be intended for larger running currents than we're speaking of, though I'm not very familiar with all the options.
I'll add one more thing. Even a lot of consumer electronics lacks any inrush limiting, and generates a tiny spark when power is applied. You simply never see it, as it's hidden away inside a power jack or switch. So you needn't banish every spark in every instance, only when it's excessive or is suspected of causing a problem.