Thanks @barucden … I overlooked the docs. Marking your reply as a solution.
Yet, it is not completely clear why 2^g() where g() is inferred to be an Int should behave differently. g() is not a literal true, but there should be a code path where literal_pow and pow should behave the same for provably integer exponents.