I actually did some work earlier in the year to fullscreen code blocks. First, you have to have the show_copy_button_on_codeblocks setting enabled. Then, any code block that has a horizontal scroll will have 2 buttons – the copy button and the fullscreen button (the copy button will be there regardless):
Then a modal will be shown without the horizontal scrolling:

