Compared to many other programming languages, TeX is unusual in that we can arrange to 'smuggle' a value out of exactly one grouping level. In functional/procedural languages, grouping works differently and the closest equivalent idea is returning a value from a function (something that TeX cannot really do). As expl3 is after all just a wrapper around TeX, we are limited in what we can do to what makes sense at the TeX level.
If you are happy using a global variable (as one might do in a functional language when the value isn't a return one) then the approach suggested by yo' is entirely appropriate. On the other hand, if you want to ensure that the value you are dealing with escapes only one group then what you need to do is 'smuggle' it out. With expl3 we can do that with one of the expansion control functions
\cs_new_protected:Npn \termmenu_prompt:NN #1#2
{
\__termmenu_write_out:N #1
\group_begin:
\ior_get_str:NN \c_term_ior \choice
\exp_args:NNNV \group_end:
\tl_set:Nn #1 \choice
}
The idea here that that we extract the value of \choice into the input stream, and it is then used in setting (here) the token list #2. By using \exp_args:NNNV everything is kept reasonably clear.
Smuggling a value out of a group is quite a low-level operation and therefore is dependent on TeX's expansion concept. It's difficult to suggest a better syntax (dedicated function) that would achieve the same outcome but be clearer. Either the \group_end: will be hidden or the putative function has to be exactly positioned relative to the \group_end:. One possible approach
\input expl3-generic\relax
\ExplSyntaxOn
\cs_new_protected:Npn \tl_set_after_group:Nn #1#2#3 \group_end:
{
#3
\group_end:
\tl_set:Nn #1 {#2}
}
\cs_generate_variant:Nn \tl_set_after_group:Nn { NV }
\group_begin:
\tl_set:Nn \l_tmpa_tl { foo }
\tl_set_after_group:NV \l_tmpa_tl \l_tmpa_tl
\tl_set:Nn \l_tmpa_tl { bar }
\tl_show:N \l_tmpa_tl
\group_end:
\tl_show:N \l_tmpa_tl
Done in this way, we would need a dedicated function for each variable type (presumably with no gset versions!). One might then make some generic set up (\group_set_after:nNn { tl } \l_tmpa_tl { foo }) but this seems more awkward. If there is a real need for this type of functionality please raise on LaTeX-L! (One obvious issue here is the code is dependent on \group_end: appearing in the following tokens.)