Cut off both ends of the eggs, then slice them in half crosswise. Remove the yolks to a mixing bowl and reserve the whites. (You can discard the ends or press them through a sieve and add them to the Japanese or Vietnamese garnish below.)
Combine the shallot, lemon juice, and salt and let it sit for 5 to 10 minutes.
Add the mayonnaise, mustard, pepper, cayenne (if using), and the shallot mixture to the yolks. Mash the yolks with a fork, stirring to combine all ingredients until the mixture is uniform. This can all be done up to 12 hours before serving, if kept wrapped and refrigerated.
Shortly before serving, spoon the mixture into the egg white halves (or put the yolks into a plastic bag, snip off the corner, and pipe the yolks into the whites).