This feature is extremely important for our use cases (using Discourse as an alternative to Atlassian Confluence as an enterprise intranet). The WYSIWYG editor significantly lowers the barrier to participation, but a large portion of our content consists of structured documents—naturally with different heading levels. If all other necessary formatting options are easily accessible, but the central headings are not, this creates a problematic UX inconsistency.
I would therefore recommend a simple implementation as a dropdown button with H1 to H6. Ideally, it would also be possible to display the current “state”—for example, if the cursor is on an element with a heading, the button would show “H3” or similar. Consistently, this should also apply to other formatting options (bold, etc.). However, while this state display would be nice to have, the button itself is extremely important.