You could use WorldEditv2 which can be found on github. Or you could also use a map converter plugin also found on github I believe nethergames uses it and set the value in it to convert. Easiest in my case is to use MagicWEv2.
Would probably be more practical to use a map converter plugin. You're selecting the whole world here, not a small selection. If you do want to go with the WorldEdit route though, and the selection is large, use WorldStyler by Muqsit instead. It can set large selections far quicker than MagicWEv2.
I think this should work PHP: $glassBlocks = [];foreach($glassBlocks as $block) { $block->level->setBlock($block, BlockFactory::get(Block::AIR));}
Long story short, you can't do that efficiently. When the new chunk format is implemented you'll be able to swap two runtime IDs to easily achieve that.