get_bb_var uses bitbake -e to fetch variables, this consumes about 7 seconds to get a variable. It exists get_bb_vars that gets a list of variables in just one bitbake -e run, so if there are two or more get_bb_var together it would be possible to use this function instead.
Sent patch to the mailing list: https://patchwork.openembedded.org/series/5239/
This has been solved in commit: http://cgit.openembedded.org/openembedded-core/commit/?id=e53f86ba8aeb6d2e9eb259329001d27d62401072