There are no requirements in the NEC or IBC as to where switches need to be located, 210.71(A)(1) only say a room needs a "wall switch controlled outlet" it does not dictate where this switch is to be located as that is left up to design and not code:
(1) Habitable Rooms. At least one wall switch–controlled
lighting outlet shall be installed in every habitable room
and bathroom.
I don't see any location mention in the above code rule.
If it was a requirement then it would be most likely worded like it is for storage spaces in 210.71(A)(3)
(3) Storage or Equipment Spaces. For attics, underfloor
spaces, utility rooms, and basements, at least one lighting
outlet containing a switch or controlled by a wall switch
shall be installed where these spaces are used for storage or
contain equipment requiring servicing. At least one point of
control shall be at the usual point of entry to these spaces.The lighting outlet shall be provided at or near the equipment
requiring servicing.
As we can see very different language.
As for the "too close to the shower" well code says it can be right next to the shower space but not within:
404.4 Damp or Wet Locations. A surface-mounted switch
or circuit breaker in a damp or wet location shall be enclosed
in a weatherproof enclosure or cabinet that shall
comply with 312.2. A flush-mounted switch or circuit
breaker in a damp or wet location shall be equipped with a
weatherproof cover. Switches shall not be installed within wet locations in tub or shower spaces unless installed as
part of a listed tub or shower assembly.
The same goes for receptacles, they can be located right up next to a tub or shower, most look at this is if it's not over the foot print of the tub/shower ( the wall or tub rim) then it is not within the space.