bitbake -e is a very useful tool for debugging and have a quick look at variables. This command has been abused and used to get bitbake variables for other process, as an example check get_bb_var in lib/oeqa/commands. So, it would be good just to get the variables without all the comments or functions. I don't know if this would speed up the bitbake when returning the variables, but at least the RE searching will be improved with less text.
Coincidentally I just filed a bug for something similar recently, so we might as well continue tracking it under that bug. *** This bug has been marked as a duplicate of bug 10748 ***