Question: Would it be wiser to exchange US Dollars to Mexican pesos prior to traveling to Cuba, and then MXN pesos to CUC, or should I just exchange US Dollars to CUC when arriving in Havana?
Answer: It will be to your advantage to take Canadian dollars or Euros instead of USD. Whether it is also advantageous or not to take Mexican pesos will depend on the exchange rate you get. The page with the change house rates (See link below) in Cuba has the current rates on that end so you can make your calculations.
After the 10% penalty (surcharge) is subtracted and the commission (under 3%), the USD is exchanged at a fraction over 0.87 cents CUC.