After some investigation I've found what is the reason of the problem above and can answer my own question myself :-).
It turned out macros for output values of variables to a terminal and a log file (\tl_show, \str_show, \int_show etc) are implemented using TeX error message mechanism. It means that pdflatex (even without -halt-on-error option) still returns a non-zero exit code and any build utilite (latexmk) or IDE calling pdflatex will be notifying about a build error. For example in case of VSCode + LaTeX-Workshop it looks like below

More detail about it can read here Using \show in nonstopmode causes TeXmaker to raise false alarms. Any fix?. Here How can I make TeX stop on the first error, but do not stop on \show (or \tl_show:n)? is advised how to avoid such behaviour.
It seemed the most suitable way for me is a reimplementation of macros for output values of variables to terminal. After some effort I've got following package
\RequirePackage{expl3}
\ProvidesExplPackage{DebugTools}{}{}{}
\cs_new:Npn __start_label: {
[DEBUG~INFO]:[line= \int_use:N \inputlineno]:~
}
%--------------------------------------------------------------------------------------------------
% Functions for output debug info in terminal and log
%--------------------------------------------------------------------------------------------------
\cs_new_protected:Npn \show:n #1 {
\iow_term:e {#1}
}
\cs_new_protected:Npn \show_sep: {
\iow_term:n {----------------------------------------------------------------------------------------------------}
}
\cs_new_protected:Npn \show_head:n #1 {
\show_sep:
\show:n {#1}
\show_sep:
}
\cs_new_protected:Npn \show_val:n #1 {
\iow_term:e {__start_label: #1}
}
\cs_new_protected:Npn \show_tl:N #1 {
\iow_term:e {__start_label: \exp_not:N #1 =~ \tl_use:N #1}
}
\cs_new_protected:Npn \show_str:N #1 {
\iow_term:e {__start_label: \exp_not:N #1 =~ \str_use:N #1}
}
\cs_new_protected:Npn \show_bool:N #1 {
\iow_term:e {__start_label: \exp_not:N #1 =~ \bool_to_str:N #1}
}
\cs_new_protected:Npn \show_int:N #1 {
\iow_term:e {__start_label: \exp_not:N #1 =~ \int_use:N #1}
}
\cs_new_protected:Npn \show_dim:N #1 {
\iow_term:e {__start_label: \exp_not:N #1 =~ \dim_use:N #1}
}
\cs_new_protected:Npn \show_clist:N #1 {
\iow_term:e {__start_label: \exp_not:N #1 =~ {\clist_use:Nn #1 {,}}}
}
%--------------------------------------------------------------------------------------------------
% Functions for output debug info in log
%--------------------------------------------------------------------------------------------------
\cs_new_protected:Npn \log:n #1 {
\iow_log:e {#1}
}
\cs_new_protected:Npn \log_sep: {
\iow_log:n {----------------------------------------------------------------------------------------------------}
}
\cs_new_protected:Npn \log_head:n #1 {
\log_sep:
\log:n {#1}
\log_sep:
}
\cs_new_protected:Npn \log_val:n #1 {
\iow_log:e {__start_label: #1}
}
\cs_new_protected:Npn \log_tl:N #1 {
\iow_log:e {__start_label: \exp_not:N #1 =~ \tl_use:N #1}
}
\cs_new_protected:Npn \log_str:N #1 {
\iow_log:e {__start_label: \exp_not:N #1 =~ \str_use:N #1}
}
\cs_new_protected:Npn \log_bool:N #1 {
\iow_log:e {__start_label: \exp_not:N #1 =~ \bool_to_str:N #1}
}
\cs_new_protected:Npn \log_int:N #1 {
\iow_log:e {__start_label: \exp_not:N #1 =~ \int_use:N #1}
}
\cs_new_protected:Npn \log_dim:N #1 {
\iow_log:e {__start_label: \exp_not:N #1 =~ \dim_use:N #1}
}
\cs_new_protected:Npn \log_clist:N #1 {
\iow_log:e {__start_label: \exp_not:N #1 =~ {\clist_use:Nn #1 {,}}}
}
\endinput
with demo LaTeX source file
\documentclass{article}
\usepackage{DebugTools}
\ExplSyntaxOn
\tl_new:N \l_test_value_tl \tl_set:Nn \l_test_value_tl {It's~a~test~value}
\str_new:N \l_test_value_str \str_set:Nn \l_test_value_str {It's~a~test~value}
\bool_new:N \l_test_value_bool \bool_set_true:N \l_test_value_bool
\int_new:N \l_test_value_int \int_set:Nn \l_test_value_int {101}
\dim_new:N \l_test_value_dim \dim_set:Nn \l_test_value_dim {-2.5pt}
\clist_new:N \l_test_value_clist \clist_set:Nn \l_test_value_clist {a,b,3,c,5}
\show_head:n {DEBUG~INFO~FOR~TERMINAL~AND~LOG}
\show_val:n {It's~a~test~value}
\show_tl:N \l_test_value_tl
\show_str:N \l_test_value_str
\show_bool:N \l_test_value_bool
\show_int:N \l_test_value_int
\show_dim:N \l_test_value_dim
\show_clist:N \l_test_value_clist
\show_sep:
\log_head:n {DEBUG~INFO~FOR~LOG}
\log_val:n {It's~a~test~value}
\log_tl:N \l_test_value_tl
\log_str:N \l_test_value_str
\log_bool:N \l_test_value_bool
\log_int:N \l_test_value_int
\log_dim:N \l_test_value_dim
\log_clist:N \l_test_value_clist
\log_sep:
\ExplSyntaxOff
\begin{document}
It's an example.
\end{document}
Now it's compiled without any error notifications and looks fine for my aims

UPDATE
Answering the question in comments I'd like to explain more detail why standard \..._show:N and \...log:N are not good for me.
\..._show:N produces following output to a terminal and a log file
> \l_test_value_tl=It's a test value.
<recently read> }
l.6 \tl_show:N \l_test_value_tl
and has next pros and cons:
Pros
- The output is enough detail and contains the line number to easy search of a place in a source file where was produced this output.
Cons
- The macro forces pdflatex to return a non-zero exit code what causes a build error notification in IDE.
\..._log:N produces following output only to a log file
> \l_test_value_tl=It's a test value.
and has next pros and cons:
Pros
- The macro doesn't cause a build error notification in IDE
Cons
- The output doesn't contain any line numbers.
Beside of this I prefer to use \..._show:N to see debug info in terminal output immediately instead of opening a log file each time after build (it's a bit annoyng).
So, I've reimplemented macros in order to achive following goals:
- to avoid any build error notifications in IDE for
\..._show:N
- to make output format for
\..._show:N and \..._log:N the same, which in addition to a variable and its value also would contain some label (to easy search of debug info in a build output) and a line number (to easy search of a place in a source file where was produced this debug info).
--hale-on-error) – Joseph Wright Feb 29 '24 at 10:19-halt-on-errorpdf is produced. It seems I've figured out with pdflatex options not carefully. Thanks! – Mikalai Strylets Feb 29 '24 at 10:57