How can I access the menu ID of an element in a WordPress Nav_Walker

If you pass the ID to wp_nav_menu() like this:

wp_nav_menu( array(
    'menu_id' => 'foobar-nav',
) );

Then you can access it through the $args parameter:

function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
    $menu_id = $args['menu_id'];
}