When we say that an algorithm runs in polynomial time, we mean that its running time is at most a polynomial of the length of the input. I assume the input is an integer $n$. The usual way to represent integers is in binary; then the integer $n$ requires $\lg n$ bits to represent. Therefore, a polynomial-time algorithm will have a running time that is at most $p(\lg n)$, where $p$ is some polynomial.
In each step of computation, the algorithm can output at most one item (e.g., $O(1)$ bits of output). So, an algorithm with polynomial running time $p(\lg n)$ can output at most $p(\lg n)$ digits of output, for some polynomial $p$. You can think of this as at most $(\lg n)^c$ digits of output, for some constant $c$ (the constant $c$ will depend on the algorithm).
Now, $2^n$ is asymptotically much larger than $(\lg n)^c$. So, no, a polynomial-time machine cannot $2^n$ digits, when given $n$ as input.
What if the machine is non-deterministic? The same is still true. Non-deterministic means that there are multiple possible branches that the computation could follow. But for each branch, it's still true that the length of the output can be no longer than the number of steps of computation. So, each branch of the non-deterministic computation is limited to outputting at most $(\lg n)^c$ digits.
You might be wondering, what is the output of a non-deterministic machine? Well, that's not a well-defined question. Instead, for a non-deterministic machine, we can talk about the set of possible outputs. If it is a polynomial-time machine, then there are a set of possible outputs, but they will all be polynomial in length. So, a string of $2^n$ digits cannot be among the set of possible outputs; it's too long.
I sense that you are somewhat new to computational complexity. I suggest that you try to avoid thinking about "function" complexity classes until you are really solid on the "decision" complexity classes. I find the decision classes easier to think about, and the function classes harder to think about.
Is the problem in FNP? Well, probably it will be most useful to refer to the definition of FNP. I'm out of time to look that up right now and check it carefully, but I expect you're going to find that the answer is 'no', because the definition requires (explicitly or implicitly) that the length of the output be at most a polynomial in the length of the input.