This happens because the redefined \@begintheorem unconditionally calls \MakeLinkTarget{\l__block_thm_current_counter_tl}. With an unnumbered theorem \l__block_thm_current_counter_tl is empty. I guess changing this line to \tl_if_empty:nF{##2}{\MakeLinkTarget{\l__block_thm_current_counter_tl}} is enough.
If hyperref is loaded, the starred
\newtheorem
produces a warningHere's an example.
This happens because the redefined
\@begintheorem
unconditionally calls\MakeLinkTarget{\l__block_thm_current_counter_tl}
. With an unnumbered theorem\l__block_thm_current_counter_tl
is empty. I guess changing this line to\tl_if_empty:nF{##2}{\MakeLinkTarget{\l__block_thm_current_counter_tl}}
is enough.