For the sauce: Combine the basil, pistachios, olive oil, lemon zest and garlic in a food processor. Pulse until roughly pureed. Remove the contents to a small bowl and stir in the mayonnaise and Parmigiano-Reggiano. Season with the salt.
For the seafood: Fill a heavy-bottomed Dutch oven with 3 inches of oil and heat to 350 degrees F.
Whisk together the rice flour, cornstarch, polenta, pepper and 1/2 teaspoon salt in a medium bowl. Working in batches, dredge the shrimp and calamari in the flour mixture and add to the hot oil, being careful not to overcrowd the pan and drop the temperature. Fry until light golden brown and cooked through, 1 to 2 minutes. Use a spider to remove the seafood to a paper towel-lined tray and season with a pinch of salt. Continue with the remaining shrimp and calamari. Serve hot alongside the pesto dipping sauce and lots of lemon wedges.