I know you'll love this answer -
The IRS does not dictate how you do your books. They only want you to do them in a consistent manner. There are a number of inventory costing methods, some of which come and go in popularity depending on how inflationary the period.
There is FIFO, first in, first out. Here you keep track of each item from when it fist came into inventory until it has been sold. So if you bought 10 at $ 1 and sold them down to 2 and bought 10 more at $ 1.25 you would have 2 at $ 1 and 10 at $ 1.25. The next two sold would be costed at $ 1.00 and the next salesa at !.25.
Then there is LIFO, Last in, first out. The same scenario would have the next two (and the next 8 after that) go out at $ 1.25 cost and only when you sold the absolute last 2 in your inventory would you cost them at $ 1.00. Now this does not mean the actual items, you could have sold the 2 from the original order, but they still would have been costed at $ 1.25.
To futher confuse things, there is Average Cost, which is what QuickBooks uses. It just keeps adjusting the cost as inventory comes and goes.
And there is also "Replacement Cost", so that the last price you paid, or the current price from your supplier (even though you have not actually bought any at that price) is the accepted cost.
Now, down to your real question - whether to include shipping and other charges in your inventory costs. I do. I use a program that makes it easy.
The term for this is "Landed Cost". It's real purpose was for importers who have to pay a number of fees in addition to the cost of the goods. They may have brokers, storage, port fees, ocean shipping, on land trucking and more. Landed Cost covers all of these.
In my case, I use a Point of Sale program that offers using landed cost as an option. In fact, when I receive an order / invoice I simply enter the shipping charges and it distributes those charges evenly by percentage of the total order across the items received. So I always know exactly what I "have in" an item.
You can do the same. It is a recognized way of costing inventory, but can be a headache to compute without some help from a program.
But, you don't have to.
If you don't use landed cost, I would suggest having an account in your "Sales / Cost of Sales" section of your chart of accounts. Using numbered accounts, this is usually in the 400 or 4000 range. By setting up an account like "Freight In" in that area the program will include that cost when calculating your Cost of Goods Sold and also take it into account when doing a Profit and Loss or Income Statement. This is how it should be. It will also show properly when figuring Gross Profit.
You can show it lower down the chart of accounts, but it does skew your figures. Freight In is not really an Expense, it's a cost of getting the goods on your shelf and if you ever start comparing figures with similar businesses, yours may be way off.
As I said at the beginning, the IRS doesn't really care. Pick one method and stick with it and they are satisfied. (I started to say "happy", but they are never that.) And in some cases, like changing from LIFO to FIFO or vice-versa you must have written permission to do so and can only make the change once in something like 7 years.