Carefully transfer sugar mixture to the bowl of a stand mixer fitted with the whisk attachment. Beat at high speed until stiff peaks form and bowl is cool to the touch, 7 to 8 minutes. Add butter, 2 tablespoons (28 grams) at a time, beating until combined after each addition. (If buttercream breaks, beat for 2 to 3 minutes, and the emulsion will come back together.) Add vanilla and salt, and beat at medium speed until combined. Add melted chocolate (if using), and beat just until combined. Use immediately, or refrigerate in an airtight container for up to 3 days. If refrigerating, let come to room temperature and rewhip before using.