As shown in the code below, in order to use the result of \testSet{a=400, b=900}, I have to declare a global variable \g_test_result_fp and define a \testGet command. Can I directly use \fpeval{\testSet{a=400, b=900} + pi}, or in other words, is it possible to create an expandable key-value command?
\documentclass{article}
\ExplSyntaxOn
\fp_new:N \l_test_a_fp
\fp_new:N \l_test_b_fp
\fp_new:N \g_test_result_fp
\keys_define:nn { test }
{
a .fp_set:N = \l_test_a_fp,
b .fp_set:N = \l_test_b_fp,
}
\NewDocumentCommand { \testSet } { m }
{
\keys_set:nn { test } {#1}
\fp_gset:Nn \g_test_result_fp { \l_test_a_fp + \l_test_b_fp }
}
\NewExpandableDocumentCommand { \testGet } { }
{
\fp_use:N \g_test_result_fp
}
\ExplSyntaxOff
\begin{document}
\testSet{a=400, b=900}
\testGet
\fpeval{\testGet + pi}
%\fpeval{\testSet{a=400, b=900} + pi}
\end{document}

\keys_define:nnis protected so there is nothing you can do here to make\testSetexpandable if it uses that function.\keys_set:nn. by 'nothing', I mean 'nothing the latex people would approve'. you could doubtless do something of which they would not approve, but it would have to rely on implementation details, in which case it would be better to use something other thanl3keys.