Is it permissible to discuss sexual matters with friends of the same gender if it doesn’t lead to sexual excitement?

Yes as long as the talk is appropriate.