In my game my player is controlled by a character controller. I would like it to be able to collide with enemies which cannot be pushed.

What would be the best way to handle this? Would it be possible to also represent enemies with a character controller so I can make them walk, while ensuring that the player can neither walk through them or push them?

The easiest approach would be to increase the mass of the enemies relative to the player and adjust the characters' force-related properties proportionally. This wouldn't make it impossible to push the enemies, but it would be a lot more difficult. (Increasing the force applied by the constraints without increasing mass would also make them hard to push, but they would accelerate faster due to greater force applied to the same mass.)

If the enemies should be truly impossible to push by the player, a somewhat-nonphysical solution will be required. One option would be to disable collision between the enemies' character controller bodies and the player's body, and then make kinematic entities which exactly follow the enemy characters' movement by setting their positions and velocities every frame to match. These kinematic entities would have their collision rules set to only collide with the player, ensuring that enemies would still behave as expected when walking around other dynamic objects.

I considered greatly increasing the mass but was concerned this could lead to enemies behaving weirdly due to gravity, for example when falling off of large ledges. Is this concern unfounded or is there anyway to overcome this sort of problem?

I'm not sure I follow what you mean by kinematic entities? Do you mean create something like a cylinder shape?

I considered greatly increasing the mass but was concerned this could lead to enemies behaving weirdly due to gravity, for example when falling off of large ledges. Is this concern unfounded or is there anyway to overcome this sort of problem?

Fall speed will be unaffected by the mass, since gravity applies a constant acceleration to all objects.

One potential issue would be mass ratios. Very heavy objects depending on light objects can cause problems for the solver. For example, if a very heavy enemy tried to stand on a light box, the box could get squished out weirdly. Keeping masses within a factor of 10 of each other is a good idea.

I'm not sure I follow what you mean by kinematic entities? Do you mean create something like a cylinder shape?

Kinematic entities are entities which have effectively infinite mass. In other words, they go exactly where their velocity takes them, and no physical force can change their motion.

Creating an entity without specifying a mass, setting an entity's mass to 0, or calling entity.BecomeKinematic all produce a kinematic entity. So doing something like this would work: