The use of the term sir as a form of address for men, especially those of higher rank or status, is discussed in several prior questions including this one. They all indicate that the term is reserved to males, and that there are a number of related terms for females, such as ma'am.
A review of the first dozen online dictionaries at onelook.com confirms that sir is strictly reserved for male addressees. For example ODO defines it as
used as a polite or respectful way of addressing a man, especially one in a position of authority: excuse me, sir
On several recent television shows in the US, the term sir has been used by a police officer to address his or her supervisor who was female. In the context, the use was sincere and was not objected to by the superior.
Has the use of sir when addressing a superior female in a military or quasi-military setting become acceptable, or is this merely literary license?
That's not "merely…" nor any "literary license"; it's a mistake.
Some episodes of Star Trek: Voyager - 500 years in the future - address female Captain Janeway as "Sir…" but in some way not explained, her case is special. Unless I was asleep on watch, no other senior women are called "Sir…"
However many TV shows use the term "sir" for female superiors, with of without objection, how could you or anyone seem "sincere" while stripping "sir" of its capital?
– Robbie Goodwin Jun 26 '20 at 00:24