\cs_new:Nn
  \example_unexpandable_first:
  {
    \tl_set:Nn
      \l_tmpa_tl
      { bar }
    \c_true_bool
  }
\cs_new_protected:Nn
  \example_unexpandable_second:
  { \c_true_bool }
\cs_new:Nn
  \example_restricted_expandable:
  {
    \bool_do_while:Nn
      \c_false_bool
      { }
    \c_true_bool
  }
\cs_new:Nn
  \example_expandable:
  { \c_true_bool }
\bool_set:Nn  % error on this line
  \l_tmpa_bool
  { \example_unexpandable_first: }
\bool_set:Nn  % error on this line
  \l_tmpa_bool
  { \example_unexpandable_second: }
\bool_set:Nn  % error on this line
  \l_tmpa_bool
  { \example_restricted_expandable: }
\bool_set:Nn
  \l_tmpa_bool
  { \example_expandable: }

.
