Yeah, I think costly signalling is definitely part of it. I think there’s really several different things going on in the birthday example. One, the friend knows that you decided to spend the evening with them, so they can infer that you want to perform friendship, and/or anticipate having a good time with them, enough to make you decide that. This is the costly signalling part. But then there’s also the stuff that actually happens at the party: talking, laughing together, etc. I think this is what actually accounts for most of the “feeling closer”. (Or perhaps these two effects act on different levels of “feeling closer”).
Anyway this is maybe getting unnecessarily analytical.
You can get into some weird, loopy situations when people reflect enough to lift up the floorboards, infer some “player-level” motivations, and then go around talking or thinking about them at the “character level”. Especially if they’re lacking in tact or social sophistication. I remember as a kid being so confused about charitable giving—because, doesn’t everyone know that giving is basically just a way of trying to make yourself look good? And doesn’t everyone know that that’s Wrong? So shouldn’t everyone just be doing charity anonymously or something?
Luckily, complex societies develop ways for handling different, potentially contradictory levels of meaning with grace and tact; and nobody listens too much to overly sincere children.