Older Volvo starting rpm problem

We just brought a 2000 S70 Volvo 5 cyl. sadan. There is a problem when we start it up. Initially it starts up fine, but when you put it into drive, the rpms do not stay constant enough to keep the engine from stalling out. When you restart it, the problem repeats and repeats about five or six times, until the problem corrects itself. If in an effort to increase the rmps by applying the gas pedal, the problem may cease, but not always. Once the rpms remain constant, there are no longer any problems with the engine.
This problem is not a constant. It mostly happens when the engine is cold, but it can also happen when the car has been running and then turned off. When you turn on the warmed up engine, the problem happens again.
Because we anticipate the repairs on a Volvo are likely to be expensive, we would like to have an idea of what could cause this problem and an anticipated cost.
Thanks for any help you might offer.

I would start out by cleaning the throttle body and the IACV (intake air control valve).

A 2000 should have an OBD II engine computer. Have you had anyone check for stored engine codes? If Circuitsmith’s suggestions don’t resolve the problem, the next suspect is a vacuum leak. A leaking intake manifold gasket will tend to leak less when the car is warm, and a warmed up car has more authority to control its mixture, so it will be worse when the car first starts. Try an unlit propane torch or a can of ether (diesel starting fluid) to find a vacuum leak (be careful).