Stacked Bars with different number of bars per x value?

Is there a way of having stacked bar charts, which would have different numbers of bars (rectangles in the y axis) for different stacks?

Here is an example of data

file-sizes-per-directory = {
 'dirA': [10, 20, 30, 40, 50],
 'dirB': [10, 15],
 'dirC': [5, 10, 10, 5, 73, 89]

I came to a solution by

  1. combining those arrays into a 2D array
  2. transposing it (with zip_longest, filling blanks with 0s)
  3. adding a Bar trace per row.

But that feels REALLY clunky…