The lime curd may be made up to 1 day in advance.
Whisk together sugar and cornstarch in a medium saucepan; add egg yolks, lime zest and juice, butter and salt and whisk to combine. Bring to a simmer over medium heat, whisking constantly, until thickened, about 5 minutes. Strain curd through a fine mesh sieve into a bowl. Stir in tequila and Cointreau, if using. Press plastic wrap directly onto surface to keep a skin from forming. Refrigerate 1 hour.