If one said “I am a nazir” without any intention of becoming a nazir (rather jokingly in response to a comment made to him about his hair being long), what is one to do if anything? Thanks.
There is no need to do anything. Saying “I am a nazir” when the circumstances clearly indicate that it is not meant seriously (for example: saying it as part of a study session) has no effect, and there is no need for concern.
Sources: See Rosh, Nedarim 27 who explains that when cicrucmstances demonstrate that a person is not sincere, the words he utters do not take effect; see also Tosefos, Kiddushin 49b (s.v. Devarim). The major debate on this subject is with regard to kiddushei sechok, a boy who “jokingly” tells a girl that she should be married to him, and gives her some item of worth. Although with regard to kiddushin some authorities are stringent (see Rema, EH 42:1, and Chasam Sofer, EH no. 85), this stringency applies only to the area of kiddishin, because of the special stringency of an eishes ish (even there, the conclusion of most stories is that there is no need to give a get), and in other areas there is no need for stringency.