Devein shrimp in shells by pushing a toothpick perpendicular to each shrimp through a joint on the back shell and about 1/8 inch under the vein; pull up to lift out dark vein. If it breaks, repeat at another shell joint. If using shelled shrimp, slit shrimp backs and pull out vein. Rinse shrimp, put in a bowl, and add sake and cornstarch; stir to mix well.
In another small bowl, combine soy sauce, vinegar, and ginger.
Pour about 1 inch oil into a 14-inch wok or deep, narrow 3- to 4-quart pan over high heat. When oil reaches 375°, add half the shrimp; stir often until they turn pink and shells are crisp, about 2 minutes (about 1 minute for shelled shrimp). With a slotted spoon, transfer shrimp to towels to drain. Repeat to cook remaining shrimp.
Drain oil from wok; discard or save for other uses. Set wok over medium heat, add garlic and salt, and stir until pan is hot. Add shrimp; stir until shrimp are coated with garlic mixture and hot, 1/2 to 1 minute.
Pour shrimp onto a platter, sprinkle with basil, and serve with ginger dipping sauce. Eat shells, if desired, or peel shrimp.