You did not test where the if (debugEnabled) is before the logging function is even called. Although according to what was posted above it should be nearly the same result as the "closure" method.
Well, OP, I don't think your topic is ridiculous. I'm glad to learn from Bruce and @hubitrep 's test that your genuine concern probably doesn't have any meaningful impact on hub peformance, something that I myself have wondered at times about logDebug(msg). Thanks for prompting discussion on it in a way that helps me learn more about development for this hub.
Thanks. After all the discussion, in the end it is a simple matter (in my opinion).
Be it considerable or small impact, there is a better way to do it, that uses less resources, and that doesn't cost more to implement, and to change existing code is a matter of search and replace. But anyone is free to disagree.
Answering a question I had above, it seems the compiler is smart enough to detect this at compile time. So, I don't really think it's worth worrying about. If you aren't using string interpolation, it will produce just a String anyway, and if you are ... well, presumably you did it for a reason.
If you have a line of code that only runs rarely (relatively, anyway), the savings from manual optimization isn't likely to be detectable.
However, if you have a tight loop or some other such situation where it's running hundreds or thousands of times in short order, it may well be worth manually optimizing your code (and more than just debug logging).
Good information to ponder and keep in mind--but most critical to consider in those (likely more) limited situations.