Depending on agency policy, there may or may not be a specified way of conducting a traffic stop that might include suggestions or mandates of what to say. Texas DPS troopers have very specific guidelines that control how they conduct their traffic stops down to some detail. Other agencies have no guidelines, or they don't get down to what to say when details.
Either way, there isn't a cop around who doesn't understand that in every contact with a citizen he/she has to take control and maintain control or else it can all go to hell. Done properly, a traffic stop is a complicated activity with multiple potential and real dangers that have to be addressed simultaneously. Done wrong, somebody can get hurt or killed.
While an officer is conducting a stop he/she is responsible for your safety (a traffic stop is a custodial event of a slightly limited legal nature and that means we have to not do something that will get you hurt during the stop, and try to prevent you from doing anything that will get you hurt). Your movements have to be controlled for your own safety (and ours also).
In any traffic stop I am worried about getting run over by some drunk or poor driver, or assaulted by somebody who interjects themselves into the scene (happens ever day). And of course I have to worry about
you, because I have no idea if you're a bad guy or just a regular citizen.
Hanging my butt out in moving traffic is dangerous, and I
really want to get control of the elements I
can control (like the driver and passengers) as quickly as possible so I'm not distracted when senile granny grump veers off the road toward us in her Lincoln Town Car. Most line of duty deaths are the result of armed assaults, but running a close second are traffic related accidents.
Additionally, the police are not going to adjudicate your guilt or innocence out there on the street. They have courts and juries for such things. I want your DL in my hand before I give you the opening to start arguing, flirting, lying, or whatever you might do to talk your way out of a citation. If I give you the opening to start babbling before I get your DL, then I could find myself having to convince you of your guilt so I can get the DL and write the ticket. Or arrest you because you don't want to give me the DL because you
know I'm wrong and are going to argue until you prove it.
So, it's all about exercising control to maintain safety, cut back on the roadside shouting/wrestling matches, and get the job done more efficiently.
Personally, once I got the DL and verified it was you, the next words out of my mouth were, "the reason I stopped you this evening is because I saw ...."
Here's an interesting video talking about maintaining control and how traffic stops go bad. There's a few points I don't agree wholeheartedly with, but it's a good discussion. Notice that on the good traffic stop the officer explains why he stopped the motorist before asking for her DL - a tactical error in my book, but obviously not everyone agrees with me.
Chicago Police Traffic Stop Guidelines - YouTube