Fastest Way To Query Multiple Objects by Primary Key?

I would typically build a query string and use that instead.

let queryString = ""
for path: String in pathsToFetch
{
  if queryString = "" {
    queryString = "_id == \"\(path)\""
  } else {
    queryString += " || _id == \"\(path)\""
  }
}

Then I would use that to filter for the objets:

const items = someRealm.objects(FileItem.self).filtered(queryString)

This should give you a Results object that you can still do all the Realm stuff you want.