If somebody gave you a bottle of wine, and you say I don't drink. They ask why, and you answer, jokingly 'I'm a nazir'. Did you take on a vow even though you only intended to joke?
Cases like this are best handled by a qualified authority of Jewish Law so if this question actually applies to you I would recommend speaking with a rabbi.
The Shulchan Aruch rules (YD 217:1) that in terms of vows we follow the local speech patterns (בנדרים אחר לשון בני אדם) so it seems to me in this case the person was obviously joking and therefore we would not hold him to his words. See also YD 218:1 which speaks more on this and also the commentaries there.
Something I ponder on is whether or not a person who did take a vow of Nezirus nowadays if they would be able to perform Hataras Nedarim and be free from their vow. I honestly don't see why not. But that is a further question that cannot be answered here.
Please don't try this.
The Mishna Nazir 11A says
מָזְגוּ לוֹ אֶת הַכּוֹס וְאָמַר הֲרֵינִי נָזִיר מִמֶּנּוּ הֲרֵי זֶה נָזִיר
If a cup of wine was mixed for someone and he said "I am a nazir from it." He is a Nazir
The Rambam Hilchos Nezirus 1:11 says further (also based on further in the Mishna)
מָזְגוּ לוֹ כּוֹס שֶׁל יַיִן וְנָתְנוּ לוֹ לִשְׁתּוֹת וְאָמַר הֲרֵינִי נָזִיר מִמֶּנּוּ הֲרֵי זֶה נָזִיר גָּמוּר. וְאִם הָיָה מַר נֶפֶשׁ אוֹ כּוֹעֵס אוֹ מִתְאַבֵּל וְהָיוּ מְבַקְּשִׁין מִמֶּנּוּ שֶׁיִּשְׁתֶּה כְּדֵי לְשַׁכֵּחַ עֲמָלוֹ וְאָמַר הֲרֵי זֶה נָזִיר מִמֶּנּוּ הֲרֵי זֶה אָסוּר בְּאוֹתוֹ הַכּוֹס בִּלְבַד וְאֵינוֹ נָזִיר. שֶׁלֹּא נִתְכַּוֵּן זֶה אֶלָּא שֶׁלֹּא יִשְׁתֶּה כּוֹס זֶה
If a cup of wine was mixed for a person and given to him to drink and he said: "I am a Nazir from it," he is a completely a Nazir If he was embittered , angry, or in mourning and the others were trying to have him drink to cause him to forget hs turmoil and he said: "I am a nazir from this [cup]," he is forbidden to drink only that cup, but he is not a nazir. Because his intent was only that he would not drink that cup.
Neither the Rambam not the Mishna make any allowances for saying I was joking. They both clearly say that you become a Nazir for saying it in this context. If it were only talking about someone who WANTED to be a Nazir then of course he would become one by saying so. Why would we think otherwise?