Expression painter:currentlinewidth() returns the line width associated with the current pen.
painter:currentlinewidth()