I'd do it with property lists.
You can define a property list based on an arbitrary name, in the example Hello and populate it.
Then you can extract the items by key.
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand{\makelist}{mm}
{% #1 = list name
% #2 = key-value pairs
\prop_new:c { g_simsalabim_list_#1_prop }
\prop_gset_from_keyval:cn { g_simsalabim_list_#1_prop } { #2 }
}
\NewDocumentCommand{\getfromlist}{+O{~}mm}
{% #1 = optional separator, default a space
% #2 = list name
% #3 = list of keys
\simsalabim_list_get:nnn { #1 } { #2 } { #3 }
}
\seq_new:N \l__simsalabim_list_get_seq
\cs_new_protected:Nn \simsalabim_list_get:nnn
{
% clear the temporary sequence
\seq_clear:N \l__simsalabim_list_get_seq
% populate it by cycling over the last argument
\clist_map_inline:nn { #3 }
{
\seq_put_right:Nx \l__simsalabim_list_get_seq
{
\prop_item:cn { g_simsalabim_list_#2_prop } { ##1 }
}
}
% output the items with the desired separator
\seq_use:Nn \l__simsalabim_list_get_seq { #1 }
}
\ExplSyntaxOff
\makelist{Hello}{
A=something specific,
B=something else specific,
C=something extra specific,
Z=something super weird
}
\begin{document}
With spaces: \getfromlist{Hello}{A,C,Z}
Paragraphs
\getfromlist[\par]{Hello}{Z,B,A}
\end{document}

Note: if an item contains either a comma or an = character, you have to use braces like below
X={math, $a=b$},
If you need to add to lists (or replace values), you can do as follows.
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand{\makelist}{mm}
{% #1 = list name
% #2 = key-value pairs
\prop_new:c { g_simsalabim_list_#1_prop }
\prop_gset_from_keyval:cn { g_simsalabim_list_#1_prop } { #2 }
}
\NewDocumentCommand{\addtolist}{mm}
{% #1 = list name
% #2 = key-value pairs
\prop_gput_from_keyval:cn { g_simsalabim_list_#1_prop } { #2 }
}
\NewDocumentCommand{\getfromlist}{+O{~}mm}
{% #1 = optional separator, default a space
% #2 = list name
% #3 = list of keys
\simsalabim_list_get:nnn { #1 } { #2 } { #3 }
}
\seq_new:N \l__simsalabim_list_get_seq
\cs_new_protected:Nn \simsalabim_list_get:nnn
{
\seq_clear:N \l__simsalabim_list_get_seq
\clist_map_inline:nn { #3 }
{
\seq_put_right:Nx \l__simsalabim_list_get_seq
{
\prop_item:cn { g_simsalabim_list_#2_prop } { ##1 }
}
}
\seq_use:Nn \l__simsalabim_list_get_seq { #1 }
}
\ExplSyntaxOff
\makelist{Hello}{
A=something specific,
B=something else specific,
C=something extra specific,
Z=something super weird
}
\addtolist{Hello}{
X={math, $a=b$},
Y=whatever,
}
\begin{document}
With spaces: \getfromlist{Hello}{A,C,Z,X}
Paragraphs
\getfromlist[\par]{Hello}{Z,B,A,Y}
\end{document}
