Employing `Union[str, int]` or `Optional[float]` (shorthand for `Union[float, None]`) directly informs AI about the precise set of types a variable or return value can hold, significantly cutting down ambiguity and boosting its ability to handle conditional logic and error paths.