Pat the shrimp very dry and season with a little black pepper. In a small bowl, stir the tamarind concentrate, fish sauce, brown sugar, and water until the sugar dissolves. Taste and add more tamarind if you want it sharper.
Heat the oil in a wide pan or wok over medium-high until it shimmers. Add the shallots and garlic and cook for about 30 seconds, until fragrant but not browned.
Add the shrimp in a single layer. Sear for about 1 minute per side, until just turning pink. They do not need to be fully cooked through yet.
Pour in the tamarind sauce and add the chili if using. Toss to coat and let it bubble for 2 to 3 minutes, until the sauce thickens and clings to the shrimp.
Stir in the green onions, cook 30 seconds more, and take the pan off the heat. Serve over rice with the sauce spooned on top.