Map array of node IDs to bundle types without loading all the nodes
Rather than trying to load all nodes, you can query the DB directly for the nid/type (Bundle) pairs you need. Query the node_field_data table and use the IN operator to retrieve all the relevant nids you need.
$nids = [1, 2, 3];
//@TODO: add select query on node_field_data
$query-&gt;condition('nid', $nids, 'IN');
//@TODO: execute query and array map results

See the drupal.org docs on using IN operator in dynamic queries.