A veteran Santa Clara County prosecutor will take office as judge a few weeks early after Gov. Gavin Newsom gave her an interim appointment Friday.