I'm not for certain but I think a 5150 may prevent you from obtaining a pharmacy tech license, I recall them asking some pretty strict questions on the application but only involuntarys show on your record so I was able to claim being mentally fit (as I technically "consented" to being admitted). I'm not entirely sure though, it's been almost a year since I got my license.
My first hospitalization was a 5150. That's also when I received my diagnosis. I can tell you for certain it does not affect work or school. I finished by Bachelor's and am a Grad student, all after the 5150. Also, when you apply for a job, the potential employer must ask you to do a background check. However, I'm pretty sure this does not show up. Best of luck!