How does that work? Is there a certain setting where extortion is legal? Do certain government officials have immunity? Is extortion permissible inide a court room? Can a police officer on the street say "hey man if you plead guilty to this speeding ticket I'll ignore the pot I smell in the back of your car"?
You don't make plea bargains with police officers.
This answer discusses the ethics of plea bargains.
Even if you made this deal with the police officer, you could renege on it at trial, and the police officer would have lost his or her opportunity to search the trunk.
Extortion is generally defined as (this example from California):
this obtaining of property from another, with his consent, or the obtaining of an official act of a public officer, induced by a wrongful use of force or fear, or under color of official right
A plea bargain doesn't result in the obtaining of property. The plea bargain exchanges your statement of guilt of crime A for the prosecutions's dropping of charges for crime B.
Plea deals may or may not be illegal if the deal offered is not directly tied to the accused crime. For example: DUI/DWI arrest is the charge but reckless driving is the deal. This plea is legal in that the act was or could be true in either case. If the charge is DUI/DWI and the deal is speeding but you were not speeding the deal is illegal as it incites a false statement. Such deals are often laced with a threat of stiffer penalty if not complied with. This form of plea deal could be considered illegal in that the required statement requires lies in a court of law.