When the initial values are not set and the arguments are empty, the current values in the variables are used, not necessarily the .initial:n ones.
.initial:n only sets the values once at point of use, without adding any way to reset those values later.
Is the situation described considered defective ? Should one actually disallow the use of the current values and reset every time a command gets called ?
\documentclass{article}
\ExplSyntaxOn
% Define a new key-value family
\keys_define:nn { mymodule }
{
width .dim_set:N = \l_mymodule_width_dim,
%%width .initial:n = 34pt,
width .default:n = 10pt,
height .dim_set:N = \l_mymodule_height_dim,
%%height .initial:n = 34pt,
height .default:n = 10pt,
margin .dim_set:N = \l_mymodule_margin_dim,
%%margin .initial:n = 34pt,
margin .default:n = 10pt,
}
% Command to use the keys
\NewDocumentCommand{\setdimensions} { O{} }
{
% Use the dimensions in your document or perform other actions
\fbox
{
\keys_set:nn { mymodule } { #1 }
\begin{tabular}{ll}
Width: & \dim_use:N \l_mymodule_width_dim \\
Height: & \dim_use:N \l_mymodule_height_dim \\
Margin: & \dim_use:N \l_mymodule_margin_dim
\end{tabular}
}
}
\ExplSyntaxOff
\begin{document}
% Example usage
With custom values:
\setdimensions[%
width = 8cm,
height = 4cm,
margin = 1.5cm,
]
With initial values:
\setdimensions
With default values:
\setdimensions[width,height,margin]
\end{document}


\keys_set:nn { mymodule } { width = 8cm, height = 4cm, margin = 1.5cm} \keys_set:nn { mymodule } { #1 }without adding any way to reset those values later.is of course incorrect you can set them at any time using\keys_set:nnthat is exactly what that command does.With initial values:is misleading, it would be better to say:With current values:as the initial values are not reset, your default version will just use whatever the current values of the keys are.\keys_set:nn { mymodule } { #1 }command as{ \keys_set:nn { mymodule } { #1 } }or not.