To exclude players of your choice, you should be able to do something to the effect of /execute at @a[name=!Aceplante] run say hi
and of course replace my name for yours. You can actually exclude as many players as you like.
If you want this to be flexible for any player running it, you could do /execute at @a[distance=0.1..] run say hi
. This would execute at all players at a distance of greater than 0 (it cannot be 0 becuase that would include you/whoever is executing the command). In survival, it is impossible for players to be 0 distance away from each other due to collision, and although they technically could in creative, it is basically impossible without intentionally doing so with the /tp command. The point being it should work without issue.