(a) Except as otherwise directed by the decedent in his or her will, upon petition of a personal representative or guardian of the estate of an incompetent person, the personal representative or guardian shall have the authority, when authorized by the court:
(1) To join with the spouse of a decedent or of a ward in the making of a joint income tax return for the decedent or ward and his or her spouse;
(2) To require such indemnity, if any, as the court may direct;
(3) To consent, for gift tax purposes, to gifts made by the spouse of a decedent or ward to the end that gifts to which consent is given shall be treated for gift tax purposes as if made one-half (½) by the decedent, or ward, and one-half (½) by his or her spouse;
(4) To enter into a contract with the spouse of a decedent or ward in respect to any joint income tax return or any such consent, or in respect to any matter arising therefrom.
(b) An order authorizing the personal representative or guardian to take any action authorized by this section shall be entered only upon a hearing, held after notice given to such persons as the court may direct. Any liability incurred by the fiduciary pursuant to any such order shall be incurred on behalf of the estate of the decedent or ward.