The cost of using a function is so small, you may as well pretend it’s free.
As to what you “should” do, you’ll get a better feel for when to use a function as you go. I don’t think there’s any hard and fast rule about all actions needing to be separate functions, but I do think there’s a great benefit to separating your code out into small chunks that are easy to understand at a glance. Maybe I’m the weird one, though, because I’ll create a function where most tutorials will just wrap some nodes in a comments block. More than around 5 nodes feels like too much to me, except for basic math operations.
That said, your spacebar event is probably in the player controller. The pawn is where the actual jumping/animation would take place, so it makes sense (to me at least) to have the Jump functionality on the Pawn, and then the controller just calls like “GetPawn()->Jump()”
If you’re just starting out, though, it’s probably better to not overthink it. Do what makes sense to you… you’ll be the one that has to look at it again later if something goes wrong lol