Mountain View is safe at night. I've walked around after 10 many times without issue.
Transit doesn't have to be too bad. There is a train to Palo Alto and San Francisco and decent bus service. You can also rent a car from Enterprise for about $20 a day if you need to go somewhere away from transit.