Id have to go with casting though I havent timed it, function calls do cost abit so thats something to take into consideration that nothing really comes for free.
The most expensive thing though is the loop so if you can cut down on iterations that would be beneficial. There is an iterator for finding all Actors of a specific Tag and this might be faster than looping (in BP) and casting your array (assuming you have quite a long list of Actors in your array because I cant see it in the image).
Internally that iterator could be doing similar to what you have here though so you might have to bechmark it yourself, you can save the time in seconds before the loop starts and then check it again once the looping is all over to see how fast its being performed.
Please dont. Go with interfaces mate, don’t listen to this GetAllActorsOfCrazySuggestion.
You drop an interface on your pawn and you can discover if that specific actor implement said interface, you can call for functions into your Pawn without ever casting to your pawn. Try avoid casting or GetAllActorsOfClass in these situations.